This error often occurs when the system ran out of memory while running a PHP application in terminal. To solve the problem do the following.


Update ini files


Set memory_limit to "-1" (unlimited) in ini files.


sudo nano /etc/php5/apache2/php.ini
sudo nano /etc/php5/cli/php.ini
sudo nano /etc/php5/fpm/php.ini

memory_limit=-1