Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2007-11-14
3
Medium Priority
?
4,262 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 1000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

971 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