Solved

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

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

947 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

18 Experts available now in Live!

Get 1:1 Help Now