PHP include_path


#1

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 ‘’

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?


#2

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.


If you want useful replies, ask smart questions.


#3

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/<…>//’

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


#4

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().


If you want useful replies, ask smart questions.


#5

Ah, thanks for the clarification.