PHP config - php.ini

Posted under » PHP » Ubuntu on 13 March 2009

Other than using different versions of PHP which I think its quite obvious, some difference is a matter of configurations which may vary from one server from another. You can change all these from your PHP.ini file. In Ubuntu, its probably located at /etc/php5/apache2.

If you are not sure, you phpinfo() and you will find it.

You may want to adjust error reporting. If you are on development server its ok to see the messages, otherwise.. turn it off.

error_reporting = E_ALL & ~E_NOTICE

Sometimes you will find your php scripts not working after you move the files from your development server to live. However as of php5, this is no longer possible.

//short_open_tag = Off 

It's kinda irritating if you leave it on and quotes appear when you don't want them.

magic_quotes_gpc = Off
In Ubuntu, the memory is set to 16mb. This is insufficient for most web server work.
memory_limit = 32M  

If you want to have mail sending facilities ... .

When you done, you should restart Apache for the changes to come into effect.

You may wish to proceed in install missing PHP libraries.

web security linux ubuntu python django git Raspberry apache mysql php drupal cake javascript css AWS data