1

When I execute the nohup command from the same folder it's working fine (server.php is used to listen to a port 7070)

root@servername:/var/www/html/admin# nohup php server.php &
[4] 2803
root@servername:/var/www/html/admin# nohup: ignoring input and appending output to ‘nohup.out’

root@servername:/var/www/html/admin# lsof -i :7070; echo $?
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
php     2803 root    3u  IPv4  21955      0t0  TCP 192.168.1.12:7070 (LISTEN)
0
root@servername:/var/www/html/admin# kill 2803

Now when i do the same command from the root it is auto exiting

root@servername:/var/www/html/admin# cd /
root@servername:/# nohup php /var/www/html/admin/server.php &
[4] 2807
root@servername:/# nohup: ignoring input and appending output to ‘nohup.out’

[4]   Exit 255                nohup php /var/www/html/admin/server.php

What am I doing wrong?

  • What is nohup.out saying? – Lambert Jul 1 '15 at 10:43
  • What are the contents of server.php? Maybe the script uses relative paths and therefore fails... – chaos Jul 1 '15 at 10:45
  • i got a nohup.out message failed to open stream: ,,, and i changed it to absolute – user1842264 Jul 1 '15 at 10:48
  • Thanks Chaos ,,, my mistake ,,, inside one more relative path was there ... thanks for pointing ,,, error_reporting was 0 for that file thats y no output in nohup thanks – user1842264 Jul 1 '15 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.