In Ubuntu I make changes to php.ini but nothing happens

Posted on

In Ubuntu I make changes to php.ini but nothing happens – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, apache-2.2, ubuntu, php, .

Hi, Apache with php works well, but none of the changes I make in php.ini have effect, I’ve even delete all the contents of the file, then restart Apache, and run phpinfo() and surprisingly everything continues working well.

The file I’m editing is the one that appears in the phpinfo() like “Loaded Configuration File”. (/etc/php5/apache2/php.ini)

P.S. I’m running Ubuntu 9.04 and PHP 5.2

More Details:

I’m restarting with sudo /etc/init.d/apache2 restart, I’ve also tried sudo /etc/init.d/apache2 stop, and then start, at restarting I get:

  • Restarting web server apache2 apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
    … waiting apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
    [ OK ]

“which php” did not produce any results.

My installation of PHP was done using Synaptic Package Manager, choosing “Mark Packages by task” and then LAMP server.

I don’t have any clue of what to do…

Solution :

I’ve had the same problem with an earlier version of Ubuntu (12.04), Apache 2.2.22 and php5-fpm fastCGI flavour of PHP.
Doing

service apache2 restart 

isn’t enough, because it just restarts the http server: you have to issue also the command

service php5-fpm restart

to have the application server restarted and PHP read the php.ini file again.

Looks like you are changing the wrong php.ini – Check the location of php.ini that is given in the phpinfo() output! This will show you the php.ini that is actually used.

Also check if the Apache restart really succeeded. 😉

Make sure you’re editing the correct file. There are several files for different circumstances all (at least on Jaunty) nestled in /etc/php5/

For apache+mod_php, you want /etc/php5/apache2/php.ini

Verify that you are not using 2 php.ini files – one for the web server module and another one for the CLI version.

Leave a Reply

Your email address will not be published.