1
votes

So I installed nginx not too long ago, and I can't figure out how to turn off magic_quotes_gpc. In the php5-fpm php.ini it has the following lines:

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

However, when I run phpinfo() the local and master value of magic_quotes_gpc are still on and it say the configuration file path is /php5/fpm/ , but no configuration file is loaded (eg. Configuration File Loaded : (none))

Let me know if you need more info. Thanks for the help.

Output of ps axu | grep php5:

root     12061  0.0  0.4 183816  4780 ?        Ss   13:11   0:00 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)
root     12118  0.0  0.0   6460   756 pts/0    S+   13:12   0:00 grep --color=auto php5

Output of ls -alF /php5/fpm/:

no such directory

Output of ls -alF /etc/php5/fpm/:

total 84
drwxr-xr-x 3 root root  4096 Nov 17 15:12 ./
drwxr-xr-x 7 root root  4096 Oct 13 12:00 ../
lrwxrwxrwx 1 root root     9 Sep  4 16:14 conf.d -> ../conf.d/
-rw-r--r-- 1 root root  3960 Sep  4 16:14 php-fpm.conf
-rw-r--r-- 1 root root 68428 Sep  4 16:14 php.ini
drwxr-xr-x 2 root root  4096 Nov 17 17:09 pool.d/
2
This is specific to nginx too. If I run my server on apache everything works fine and magic quotes is disabled.Gavin Sellers
Also check that you do not have that option enabled in the FPM Pool itself. The Pool configuration will override the settings in the php.ini file.Diemuzi
No it's not overridden in the poolGavin Sellers
After making the change, did you restart FPM? It also looks based on your question that there is no php.ini file loaded so the default settings are being used. You may want to try adding a php.ini file in the directory where PHP is looking.Diemuzi
There is a php.ini file in that directory and I haven't made changes to fpm. The pool doesn't have any gpc settings in it.Gavin Sellers

2 Answers

2
votes

The problem seems to have fixed itself since I restarted php5-fpm. I guess some configuration settings somewhere never updated when I installed nginx.

1
votes

I' had the same problem. I resolved setting in fpm/pool.d/www.conf php_flag[magic_quotes_gpc] = Off php_flag[magic_quotes_runtime] = Off

So restarted

sudo service php5-fpm restart

I hope this is helpful for your problem.

PD: Sorry by my English.