Forum Moderators: coopster
I'd like to be able to do something "on the server" that would set my include path, rather than using the
ini_set('include_path') function on every PHP script I write. Does anyone know of anything that can be done that will allow this? Incidentally, I'm on shared hosting on a Linux/Apache server. Would there be any possibility of my host being able to add the include path to my account's virtual host in his httpd.conf file?
Thanks for any ideas,
Matthew
There are three ways to change php settings
- runtime
- .htaccess
- php.ini
You don't want to do it at runtime, so that's out.
You can't do it via .htaccess, so that's out.
In theory, yes, your host could do it in php.ini. In practice, though, I would say that if they block you from making changes in .htaccess, there's a .0000000000001% chance that they would be willing make the change at the php.ini level.
If you read my post in the Best Practices thread (wait, you started that thread.. I hope you read it!) and you are putting a header file at the top of your script anyway, what's one more line in your config file?
PHP looks at environment variable PHPRC for a path to a custom php.ini. You might be able to set this environment variable using mod_rewrite or mod_env etc.
[httpd.apache.org...]
[edited by: jatar_k at 4:19 pm (utc) on Dec. 14, 2004]
[edit reason] replaced link with true apache url [/edit]