By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,741 Members | 1,832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,741 IT Pros & Developers. It's quick & easy.

php.ini location question

P: n/a
I'm trying to set the PHP include path for a PHP class on my web host, but I
don't have access to the root php.ini.

My host allows me to have my own php.ini which applies to each directory it
appears in but it seems I need to have a php.ini in each and every directory
I want my include path to apply in.

I would rather avoid having a php.ini in each directory, since it's a class
I use all over my site (phpMailer - excellent multipart email class).

Is there any way to make my php.ini in my webserver root apply to all
sub-directories, or another way to achieve this (btw - I can't use
..htaccess) ?

Thanks in advance.
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
furry wrote:
I'm trying to set the PHP include path for a PHP class on my web host, but I
don't have access to the root php.ini.

My host allows me to have my own php.ini which applies to each directory it
appears in but it seems I need to have a php.ini in each and every directory
I want my include path to apply in.

I would rather avoid having a php.ini in each directory, since it's a class
I use all over my site (phpMailer - excellent multipart email class).

Is there any way to make my php.ini in my webserver root apply to all
sub-directories, or another way to achieve this (btw - I can't use
.htaccess) ?


If you only want to set the include path, you can use ini_set to do the
job like this:

ini_set('include_path',dirname(__FILE__).'/php.ini');

Put that in a file in your docroot, put the php.ini file in the same
directory, then make sure that you include the file with that call in it
in your script.

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.