Solved

How can I force an apache alias to use the DocumentRoot .htaccess [php_value include_path]?

Posted on 2007-11-14
3
4,216 Views
Last Modified: 2008-02-01
Intro:
--------------------------------------
Ideally I would like to setup [.htaccess] with the following:
[code]
apache_value include_path "/path:/fallback_path"
php_value include_path "/path1:/path2"
[/code]

However, as the first line in that is NOT valid, I have had to try and figure out other ways of getting a fall-back path.


Current Situation
--------------------------------
I am currently using [alias] and [mod_rewrite] in [apache] to accomplish most of what I want.  However, the [alias] does NOT listen to [DocumentRoot] [.htaccess]

So for any file with <? phpinfo(); ?> in my [alias] the [include_path Local Value] takes the [include_path Master Value] instead of the what I set in [DocumentRoot] [.htaccess].

ie)
[alias] [include_path Local Value] shows as:
.:/usr/local/share/pear
Instead of:
/path1:/path2

I know I could make another [.htaccess] within the [alias] for this to work but I want each site on my webserver to be able to use a different [alias] [include_path Local Value]


Question
-----------------------------
Is there something I could set in [httpd.conf] or somewhere that would force the [alias] to use the [.htaccess] value from the [DocumentRoot]???

If NOT... Perhaps there is something else I can do?
0
Comment
Question by:razorwire
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 48

Expert Comment

by:hernst42
ID: 20287322
Not possible with apache. If the alias is not part of the document root, apache will not find the .htaccess in a directory above the file that is executed. Either you need a copy or better hardlink to the same file, so if you edit it both "files" are changes. See
# man ls
0
 

Author Comment

by:razorwire
ID: 20297347
Couldn't I set the include path somehow in httpd.conf for a specific VirtualHost and then ALL pages under that virtual host would have the same include path (including the alias)?  I mean I can set the ErrorDocument in httpd.conf on a per VirtualHost Basis and the alias will listen to that...
0
 
LVL 48

Accepted Solution

by:
hernst42 earned 250 total points
ID: 20297786
of course you can do that. use
php_value include_path "...."
See http://www.php.net/manual/en/configuration.changes.php
0

Featured Post

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question