Solved

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

Posted on 2007-11-14
3
4,178 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
  • 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now