Solved

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

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

756 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