Nohup in linux

Source: Internet
Author: User
Nohup in linux

I want to continue running a PHP program and use this command nohup/data/www/wwwroot/military/server. php &
But this error is always reported:
Nohup: appending output to "nohup. out"
Nohup: cannot run command "/data/www/wwwroot/military/server. php": no file or directory
I can confirm that the path is correct. this file and directory are available!
What's the problem? please help me !!!


Reply to discussion (solution)

The PHP file is not an executable file. of course, an error will be reported,
Nohup php-f/data/www/wwwroot/military/server. php>/dev/null &

It has nothing to do with nohup.

/Data/www/wwwroot/military/server. php cannot run directly. add the php executable file path,/data/www/wwwroot/military/server. php is passed as a parameter to the php executable file. For example,/usr/bin/php depends on your own php installation location.

Nohup/usr/bin/php/data/www/wwwroot/military/server. php



Or add the shebang comment in the first line of your server. php and grant the server. php executable permission.

#! /Usr/bin/php
...
?>

# Chmod + x/data/www/wwwroot/military/server. php

Nohup/data/www/wwwroot/military/server. php can be directly executed.




When nohup is used, no more & is equivalent to the effect of the bg command.

The answers are good. each score is 10 points. thank you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.