The easiest is to create a php.ini file inside the folder where you want to set the flags in and voila.
For example, to set register_globals off, create a php.ini with the following
register_globals = OffUpload this file to that folder and try now phpinfo() to see the local settings for register_globals. Yes it is off.
This setting in important to get rid of the warning you got from Joomla or Moodle.
PHP is really an amazing language.
4 comments:
salam Bilal,
I tried your idea but it didn't work for me. i have php runing as CGI, i use Jooml so i set session.use_cookies to true. but in the same time, i must use set it to false for some other web sites.
i want to use the original php.ini with joomla and the local (with session.use_cookies = 0) with the other web sites.
if i put my local php.ini in a web site folder no thing change, phpinfo()shows that.
please, can you explain more.
Mohamed from morocco.
Salam Mohamed,
I am not sure about the settings of your server but it worked on mine.
Unlike .htaccess files that affect the working directory AND all subdirectories, php.ini files ONLY affect working directories when PHP is running as CGI.
Thus if you have to create a php.ini for every directory you want your PHP settings to apply to.
Also, I've developed in environments that execute PHP as CGI using suEXEC, which *will* look at .htaccess file, although I'm not sure if you can override php setting from within .htaccess at that point.
Post a Comment