Category Archives: Software

Fix “Fatal error: Allowed memory size of X bytes exhausted (tried to allocate X bytes)” with composer update

I got this error today when running composer update for one of my Symfony2 projects:

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 3781182 bytes) in phar:///usr/local/bin/composer/src/Composer/Util/RemoteFilesystem.php on line 202


Composers troubleshooting tells that you can increase the memory PHP can allocate editing memory_limit parameter in php.ini. I changed it from 128M to 512M but still didn’t work.

Finally the solution was to run composer update with no memory limit this way:

php -d memory_limit=-1 /usr/local/bin/composer update

Install JDownloader in Ubuntu 12.04

sudo add-apt-repository ppa:jd-team/jdownloader
sudo apt-get update
sudo apt-get install jdownloader


Increase the phpMyAdmin session timeout

Edit your file (in my Ubuntu 12.04 it was located at /etc/phpmyadmin/ and add the following line (where X is the amount of seconds the session will last):

$cfg['LoginCookieValidity'] = X;


In my development machine I have 36000 that is 10 hours (all work day) but you should never do this in a production environment.

You may also have to set the same value on session.gc_maxlifetime in your php.ini file because it will probably be smaller than LoginCookieValidity value you set before (it’s default value is 1440).

session.gc_maxlifetime = 36000


Using screen to leave processes running in a terminal

If you are using an SSH connection and run a command that takes very long to process you can use nohup to prevent that process to be terminated when you logut from the SSH session:

nohup command > /dev/null 2>&1 &

But using this method detaches the process from stdio, stdout and stderr (unless you redirect them somewhere, as previous example redirected them to /dev/null). If you want to be able to reattach to that process later on screen is the right tool.

Firt install screen:

sudo apt-get install screen

Then run a bash shell using screen:

screen bash

A new shell wil be openen and the you can run anything you want. Lets supose you start converting a huge video to another codec. Once the process has started you have to press CTRL+A and then D to detach from that shell. Now you’ll be back to the original shell but the video process will still be running.

If you have only one screen process running you can reattach to it by just running this:

screen -r

If you can have multiple screen processes at the same time you have to specify to which of them you want to attach. Using this command will tell you the names and some more info about all current screens:

screen -list

Then you can attach to them using that name:

screen -r name

If you want to terminate a screen process just attach to it and press CTRL+D.


Update composer and all packages installed with it

php composer.phar self-update
php composer.phar update
  • Page 1 of 2
  • 1
  • 2
  • >