Home  >  Article  >  Backend Development  >  How to modify php fpm listening port

How to modify php fpm listening port

藏色散人
藏色散人Original
2020-07-27 10:12:458428browse

How to modify the php fpm port: first open the "www.conf" file; then modify the content to "listen = 127.0.0.1:8999"; finally modify the content in "default.conf" to "fastcgi_pass 127.0" .0.1:8999" is enough.

How to modify php fpm listening port

Recommended: "PHP Tutorial"

centos6.8 Modify the listening port of php-fpm

Mainly modify the listening port of php-fpm, and then modify the configuration of nginx to correspond to the listening port of php-fpm.

1. Modify the /etc/php-fpm.d/www.conf file and change the listening value from listen = 127.0.0.1:9000 to listen = 127.0.0.1:8999

2. service php-fpm restart

3. Modify /etc/nginx/conf.d/default.conf and change fastcgi_pass 127.0.0.1:9000 to fastcgi_pass 127.0.0.1:8999

 location ~ .php$ {
          fastcgi_pass   127.0.0.1:8999;
          fastcgi_index  index.php;
          fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
          include        fastcgi_params;
 }

4 .Restart nginx (execute service nginx restart)

The above is the detailed content of How to modify php fpm listening port. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn