Archive for Thursday, 22nd July 2010

| 22/07/2010, 16:26 Detaching a PHP script from the shell on Ubuntu

I've learnt that detaching a PHP script from the shell and allowing it run as a daemon on Ubuntu is not as simple as I first thought.  I couldn't simply add an ampersand like this:

$ php ./script &

I had to use parenthesis because I assume otherwise bash now gets confused. This is what works:

$ ((php ./script) &)&