Magic quotes isn't off (Strange problam!)
I tried to turn off magic quotes in these places: /etc/php5/apache2/php.ini
/etc/php5/cli/php.ini
I'm sure all of them is "Off".
but it's still ON in phpinfo()! Here is my phpinfo()
magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
The only way it works is add php_flag magic_quotes_gpc Off
to .htaccess.
Now I want to disable it in php.ini
. How can???
Edit:
phpinfo() shows:
Configuration File (php.ini) Path /etc/php5/apache2
Loaded Configuration File /php.ini
so I opened /etc/php5/apache2/php.ini. These are the magic-quotes-related things:
magic_quotes_gpc = Off
; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
; http://php.net/magic-quotes-runtime
magic_quotes_runtime = Off
; Use Sybase-style magic quotes (escape ' with '' instead of ').
; http://php.net/magic-quotes-sybase
magic_quotes_sybase = Off
php.ini's settings should be respected by PHP, so if the default value is also reported to be 'On', PHP probably failed to read the value from your .ini file.
Here's what to do:
Share with us the line of config that you added to your php.ini to disable it. It may be the case that you just made a typo. It should look something like this.
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
Make sure that there aren't multiple occurrences of magic_quotes_gpc in your ini file(s)!
Make sure you're editing the correct .ini file(s)! Open your phpinfo()
's output, and look at the "Configuration File (php.ini) Path" and "Additional .ini files parsed". Check these files for an entry of magic_quotes_gpc
.
Although this is very unlikely to be the issue considering what you say phpinfo()
reported, ensure that you are not overriding stuff in your web server's configuration.
Use this function in your php file, it will works
set_magic_quotes_runtime(false);
Note
This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
链接地址: http://www.djcxy.com/p/26558.html下一篇: 魔术引号没有关闭(奇怪的问题!)