For some reason I am unable to run PHP cli scripts in the background (or from a cron job or a log-on script). On other Linux distro's this works fine, but on Ubuntu the process immediately enters a 'stopped' state.
This is a HUGE problem for me; I'm developing this for a client and we're quite a way into the project, and so far Ubuntu has been a great platform for it, but this is a major showstopper. I so totally need to resolve this or find a work-around. I already tried wrapping the PHP script in a regular bash script by adding a #!/usr/bin/php on top and running it as a shell script from the command line, but that didn't solve anything. Google tells me that this has occurred on Debian-based distro's before with previous PHP versions, and that it seems to have something to do with libraries, but the solution so far escapes me.
All suggestions would be appreciated!
Ubuntu version:
Linux 2.6.24-19-generic #1 SMP Wed Aug 20 22:56:21 UTC 2008 i686 GNU/Linux
PHP version:
PHP 5.2.4-2ubuntu5.3 with Suhosin-Patch 0.9.6.2 (cli) (built: Jul 23 2008 06:44:49)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
How to reproduce:
script.php:
<?php
while (true)
sleep (10);
?>
php script.php &
[1] 7970
me@hostname:~/scripts$
[1]+ Stopped php script.php
Thanks in advance for reading this... I'm so hoping that there is a way out of this, or I'll have to scrap Ubuntu in favor of another distro, and I really don't want to give up Ubuntu's many good features, not to mention having to go through a platform change this late in a project!
// Frank
Bookmarks