View Full Version : [ubuntu] Bang! I can't run programmer in the background

May 14th, 2008, 10:06 AM
I install Ubuntu in my server.
I found I can't run command in the background.
There is my terminal output:

rollenc@ubuntu:~$ php tmp &
[1] 22639

[1]+ Stopped php tmp
rollenc@ubuntu:~$ bg
[1]+ php tmp &

[1]+ Stopped php tmp
rollenc@ubuntu:~$ bg
[1]+ php tmp &

[1]+ Stopped php tmp
rollenc@ubuntu:~$ fg
php tmp

I use '&' to run this program in the background, but it stopped, and bg is not my friend yet.

This server is a production server, I don't wanna an OS reinstall.

Thanks for any words.

May 14th, 2008, 11:01 AM
my understanding of your problem is limited, but you might be interested in learning about screen: http://jmcpherson.org/screen.html

also, is there something in the logs indicating why php tmp is stopping?

May 14th, 2008, 01:42 PM
thanks for your post.

I checked out the /var/log/auth.log and /var/log/syslog, whice is updated after I excute the 'php tmp &', but nothing was found.

which log file I need to notice?

May 16th, 2008, 02:27 AM
I found this happened in my Ubuntu 8.04 desktop too.

May 16th, 2008, 03:25 AM
does it work at all, for a short time perhaps?

i really don't know exactly what you're trying to do, but maybe the syntax is just wrong?

php /tmp &

March 12th, 2009, 12:08 AM
[cant run php in background]

You can run php in the background with.

sh -cb 'php whatever.php &' > /dev/null

Php can also be run in the background with cron