Startup and shutdown of phpfastcgi (spawn-fcgi) in Ubuntu

Source: Internet
Author: User
Startup and shutdown of phpfastcgi (spawn-fcgi) in Ubuntu
spawn-fcgi -a 127.0.0.1 -p 9000 -C 10 -u www-data -f /usr/bin/php-cgi  

Note:

-A 127.0.0.1: PHP FastCGI binding IP address

-P 9000: PHP FastCGI specified port

-U www: PHP FastCGI user name

-G www: PHP FastCGI User Group

-F/usr/local/bin/php-cgi: Point to PHP5 fastcgi

Sudo privilege escalation

View running status

Use netstat with grep.

$ netstat -an |grep 9000tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN  tcp        0      0 127.0.0.1:9000          127.0.0.1:58879         TIME_WAIT  tcp        0      0 127.0.0.1:9000          127.0.0.1:58880         TIME_WAIT  

If this prompt appears, fastcgi is running.

If you want to view the pid, you can use ps-ef

$ ps -ef | grep spawn-fcgiubuntu   27329 24796  0 02:50 pts/0    00:00:00 grep --color=auto spawn-fcgi  
Exit
$pkill -9 php-cgi

This operation is dangerous. If you are using the nginx environment, a 502 error will be prompted when you access php on the frontend after fastcgi is interrupted. many people encounter the 502 error because fastcgi forgot to open or unexpectedly exits.

Related Article

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.