Thursday 6 June 2019

ubuntu - PHP ignoring config file

Answer


Answer




I'm trying to turn off magic_quotes_gpc in PHP. I'm running PHP with Apache and Ubuntu.




I have in my config file (/etc/php5/apache2/php.ini):



magic_quotes_gpc Off 


Where I create a page with phpinfo() it shows magic_quotes_gpc as on. I've also looked in Additional .ini files parsed and there is no setting for it.



Why is PHP ignoring this?


Answer



try to add/edit in php.ini




magic_quotes_gpc = Off 


after adding restart your apache services for taking effect this



You can turn them off using .htaccess with:



php_flag magic_quotes_gpc Off



and also using php if writable php.ini



ini_set('magic_quotes_gpc' , 0 );

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...