WARNING: Always make a backup of php.ini before making changes to it.
If you are doing this as root, you do not need to use 'sudo' at the beginning of the commands.
sudo nano /etc/php.ini
memory_limit '' 8M ; Maximum amount of memory a script may consume (8MB)
sudo /etc/init.d/httpd restart
– Main.FredPettis - 02 Jun 2009