开发者

php.ini not working in IIS?

开发者 https://www.devze.com 2022-12-17 07:07 出处:网络
I\'ve set magic_quotes_gpc = Off in php.ini,but I see it\'s s开发者_高级运维till On in phpinfo();First of all, you must be sure you modified the right php.ini file : there can be many files called php

I've set magic_quotes_gpc = Off in php.ini,but I see it's s开发者_高级运维till On in phpinfo();


First of all, you must be sure you modified the right php.ini file : there can be many files called php.ini -- and only one is "the right one".

You can see which php.ini file is used in the output of phpinfo() : there should be an entry called Configuration File (php.ini) Path that indicates the directory in which php.ini is looked for, and an entry called Loaded Configuration File that indicates the full path+name of the php.ini file that's used.


Then : don't forget to restart the webserver, so the modifications to php.ini are taken into account (Not sure that's necessary with IIS, but as it's required with Apache, I suppose it cannot hurt with IIS)


If that doesn't change a thing : what if you try to modify another directive : is the modification taken into account ?


As an alternative, you can disable it from your script too:

// disable magic_quotes_runtime
if (get_magic_quotes_runtime())
{
 @set_magic_quotes_runtime(0);
}


You can check the php.ini file that was loaded via the php_ini_loaded_file function. Restart your web server.


On my installation the c:\php\php.ini file was named php ini. So phpmyinfo() was not loading it, despite the PATH environment variable including C:\php\. (Check this in a DOS prompt with SET PATH).

So rename it to php.ini.

It was difficult to spot in Windows Explorer.

0

精彩评论

暂无评论...
验证码 换一张
取 消