Php_value .htaccess directive

software development

#1

Hi,

I’ve just installed my own copy of PEAR and want to put its path into PHP’s include_path using .htaccess, but this doesn’t seem to be working normally. Here is the content of my .htaccess file:

php_value include_path .:/home/[dhusername]/pear/php

But when I look at the output of phpinfo() I see the include_path setting hasn’t changed:

include_path .:/usr/local/php5/lib/php:/usr/local/lib/php

Any idea why this doesn’t work? It’s the same syntax I use on dozens of servers. It seems the .htaccess file is definitely being parsed because if I put garbage into it I get an error when accessing pages in the directory.

Thanks for any help you might offer…


#2

PHP is running as CGI and won’t look for Apache directives.

You could try setting the path in your php.ini :

include_path=".:/home/[dhusername]/pear/php"

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#3

Thanks - that was very helpful, if disappointing. Where would ‘my’ php.ini file be? The one at /etc/php5/cgi/php.ini doesn’t seem to be editable - I got that path from phpinfo().


#4

You’ll need to set one up to try it (see my signature).

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#5

This is all a bit overcomplicated. I think I’ll suggest another hosting provider. Thanks for your help though.


#6

http://wiki.dreamhost.com/PEAR#Including_PEAR_modules_in_scripts

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#7

Yeah, I read that in the wiki. It’s not acceptable to have a line of code like that in every one of the scripts. The site needs to be able to be ported easily to other servers.