If you get PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 14 bytes) in /srv/www/htdocs/yourscript.php
Edit /etc/php5/apache2/php.ini
Find memory_limit = 128M ; and up the value e.g. memory_limit = 256M;
Save the file and restart apache e.g. apache2ctl restart