Linux Background running PHP script

Source: Internet
Author: User
Keywords Php linux
Existing A, b two servers, where the B server is running a 8888 port software service, a server now use the command line
PHP a.php executes this script, listens to the B server's 8888 port in real-time, if has the device publishes the message to the B server's service software, a.php will receive, then carries on the processing.

The problem now is that if you shut down the locally connected shell, the script will stop running, and how can you keep a.php in the background on the server?

Reply content:

Existing A, b two servers, where the B server is running a 8888 port software service, a server now use the command line
PHP a.php executes this script, listens to the B server's 8888 port in real-time, if has the device publishes the message to the B server's service software, a.php will receive, then carries on the processing.

The problem now is that if you shut down the locally connected shell, the script will stop running, and how can you keep a.php in the background on the server?

In addition to Nohup, you can also choose Supervisor, screen, etc.

In addition, supervisor should be the most suitable, he can be in addition to monitoring the status of the process will automatically restart when the exception exits!

Nohup PHP a.php &
Http://www.cnblogs.com/kapok/archive/2005/11/23/283108.html

Nohup command

  • 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.