George wrote:
> Dear All,
>
> I am doing some testing among multiple servers and I need to have a
> rule in my .htaccess file that looks like the following:
>
> php_value include_path path1
>
> However, the value path1 will change as the file will be uploaded to a
> number of different servers - I would like to have a variable doing
> the work rather than me changing the value manually?
>
> Is there a trick for that? I tried
>
> php_value include_path $_SERVER['DOCUMENT_ROOT']
>
> but it failed miserably.
>
> Many Thanks,
> George
When you say it failed miserably, can you elaborate? Are you getting an
Internal Server Error (500 error), or is it just not working as
expected? Are you getting any errors? Some variables can be declared
in php.ini or .htaccess locally to your account, and some demand to be
in the global php.ini and can't be overriden locally. Some need to be
in the script or are better put in the script. Also, keep in mind that
it depends on the server's configuration.
If they (the web host) use the Apache API for PHP, then, if they
allow .htaccess control files, it can work with a php_flag or
php_value, depending, and some will use suPHP or a similar wrapper
which dictates you use a local php.ini (if you are allowed to). This
should be an easy and common setting, but it depends on your web host
and how they built PHP and what options you're allowed to set, or if
you need to put it in the actual PHP script source itself.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
>> Stay informed about: Is it possible to use PHP variables in .htaccess?