PHP include_path

PHP include_path

Posted by: jtey
Posted on: 2005-10-21 08:36:00

How do I set my php include_path, as I would if I had a "php.ini" to configure?

I know it's something like:

php_value include_path '<my include path>'

in my .htaccess, but my question is, where is my .htaccess file? I'm on a brand new account. Would it be located (or to be created if not exist) under my domain.com/ folder?





Edited by jtey on 10/21/05 08:41 AM (server time).

Re: PHP include_path

Posted by: kchrist
Posted on: 2005-10-21 08:51:00

Create an .htaccess file in the root directory of your site. Anything in that file is inherited by all subdirectories below the site root You can use additional .htaccess files in subdirectories to override the root one as needed.

Re: PHP include_path

Posted by: jtey
Posted on: 2005-10-21 11:10:00

I've just tried it, but it doesn't work -- I must be missing something.

I have my .htaccess file in my domain.com/ folder, with the following line:

php_value include_path '/home/.inquirer/<...>/<path>/'

Upon the php script's failure, it shows "(include_path='.:/usr/local/lib/php')", suggesting that the .htaccess php_value wasn't even invoked?

Re: PHP include_path

Posted by: kchrist
Posted on: 2005-10-21 11:39:00

Ah yes, PHP settings in .htaccess only work if you're running PHP as an Apache module, not as CGI, which is the default.

If you want to keep running as CGI, look into ini_set().

Re: PHP include_path

Posted by: jtey
Posted on: 2005-10-21 17:11:00

Ah, thanks for the clarification.

Tags: php includepathini