Forum Moderators: coopster
ok to get on with it...i am basically a php hobbyist and do my php development (for testing) on machine running win xp (please dont ban me for this...ill grow up soon) and have complete control over the php.ini.
but in reality my apps are hosted on shared linux server and so can not change any configuration over there.
i was wondering if its possible to change some vital php.ini configuration in my scripts which would override the default configs?
i can now control error reporting but can i similarly change the default include_path?
eg the default include_path is /usr/local/lib/php
id like to have it /home/includes
any help will be hugely appreciated
please dont ban me for this...ill grow up soon
I develop on a Win2K box and haven't been banned for it so far, so I think you're in the clear. And I don't plan to grow up any time soon in this respect or any other (old maybe, but not up!).
Anyway, php settings can be controlled in a variety of contexts
- runtime (with ini_set() in your script)
- per directory (with .htaccess)
- system (php.ini only).
So it depends on what you actually want to change. A complete list if which is which is available here:
[us2.php.net...]
yes ini_set works for me...but only for the time being
i'll explain => im doing all my site configuration in a file called "config.php" which im including in all other files. typically id love to put even this ini_set directive there...as id mentioned my local development platform and production level platforms are different, the include paths would be different too. and i dont want any include file to be available in my public html directory. as a result right now im doing ini_set in every file and that somewhat defeats the whole purpose of wanting to have a config.php
as ergophobe suggested and the manuals say it can be done with .htaccess too. i think thats a better idea. problem is my .htaccess doesnt seem to be working. i tried:
php_value include_path c:/php/includes
and put that in c:/www/site_v2 (thats where my index.php is) which includes config.php (residing in c:/php/includes which in turn has ini_set directive). so id not require to do .htaccess everywhere.
that should have solved all my problems...but it doesnt. am i doing something wrong here?
and thanks ergophobe for reassuring me about win xp
:)
php_value include_path ".:/usr/local/lib/php"
In your post it looks as if you are not placing quotes around your include path so I'd try that.
Also, try removing the drive letter and replacing it with the period as in above.
The single dot just tells your include() that relative includes will work too, that is, it should also use the current working directory as part of the include_path.
An example of how to specify a single simple include path in Windows:
php_value include_path "C:/php/includes"
An example of how to use your current script working directory, plus the PEAR directory, and your own special includes directory:
php_value include_path ".;C:/php/PEAR;C:/php/includes"