The important parameter to look at in the php.ini file is memory_limit which controls how much memory is allocated to PHP.
Edit the php.ini file. This file will be located in the /php/ folder. Its location will depend on the version of PHP that you are running. In my case it is:
Check that the following are set and are not commented out with a semicolon character (;)
memory_limit = 128M
display_errors = Off
register_globals = Off
The 128M setting for memory_limit is a general guideline but should be sufficient for most websites although larger websites may require 256 megabytes or more.
Save the changes by pressing Ctrl-X and then pressing Y to save.
You may want to allow logging in which case the php.ini file should have the following:
error_log = /var/log/php/error.log
Create the /var/log/php/ directory for the PHP error log with the following command:
Change the owner of the /var/log/php/ directory to www-data, which the PHP user runs as:
Restart Apache using:
The above assumes that logging is to the /var/log/php/ directory, but if you have installed a USB drive you may want to install this on the USB drive in which case the error_log setting in the php.ini file will be different.