Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've a problem on my Ubuntu Server 12.04 with PHP. As per /etc/php5/apache2/php.ini:

magic_quotes_gpc = Off

But the phpinfo.php says that Magic quotes are ON...


sebastien@thivinfo:~$ php -l /etc/php5/apache2/php.ini 
No syntax errors detected in /etc/php5/apache2/php.ini


share|improve this question
I am guessing you restarted the server or at least apache. – Goddard Dec 19 '12 at 23:29
Yep, did you run sudo service apache2 restart, after you changed the setting? – saji89 Dec 23 '12 at 5:51
Open the last file into "/etc/php5/apache2/conf.d/" folder and add "magic_quotes_gpc = Off" – Panganino May 3 '14 at 10:14


Is this problem still persists ? If you have missed the semicolon in php.ini, the changes will not reflect. try adding semicolon after each setting if you have missed.

If you are in shared hosting, there will be an option in your control panel to end the current session (something like End Web in GoDaddy). Kill that to start a new session to load your newly configured php.ini . .

PS: If the problem is in local machine, you have to restart your webserver. Also, in some hosting providers, configuration files will take effect from a specified time, like 12 00 hours GMT etc. In that case you can contact your hosting provider for that.

share|improve this answer
Thx for answer. I've my own hosting and make several times sudo service apache2 restart....I have to reboot completely my server? – Sébastien Serre Dec 20 '12 at 6:21
Just rebooted and pb allways here.... – Sébastien Serre Dec 20 '12 at 6:25

Are you sure you are modifying the correct php.ini? phpinfo() shows you were the php.ini is located.

share|improve this answer

I ran into the same problem, and it is a syntax error in php.ini even though running php -l /etc/php5/apache2/php.ini results in No syntax errors detected in /etc/php5/apache2/php.ini

I found the error in the following line in the ini file error_reporting = E_ALL& & ~E_DEPRECATED(see the double & &) changing that to error_reporting = E_ALL & ~E_DEPRECATED resolved the problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.