Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that php 9000 port is not started?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article editor for you detailed introduction of "php 9000 port did not start how to solve", the content is detailed, the steps are clear, the details are handled properly, I hope this "php 9000 port does not start how to solve" article can help you solve doubts, the following follow the editor's ideas slowly in-depth, together to learn new knowledge.

The solution that php 9000 port does not start: 1, find "php5/fpm/pool.d/www.conf"; 2, change listen to "127.0.0.1 nginx 9000"; 3, change nginx back to port listening; 4, restart nginx and php-fpm.

Operating environment: ubuntu 16.04system, PHP7.1 version, DELL G3 computer

After php-fpm starts, there is no port 9000?

Recently in the reproduction of a php extension of the backdoor, the need to build a Nginx+php environment, nginx I am naked with source code, without any third-party modules.

Php-cli and php-fpm are installed through ubuntu's standard apt-get command.

Then you need to modify nginx's nginx.conf file to support php script parsing.

After inquiry, there are two kinds of configurations on the Internet, one is

Support for 127.0.0.1VR 9000

Location\ .php$ {root html; fastcgi_pass 127.0.0.1 root html; fastcgi_pass 9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME / usr/local/nginx/html/$fastcgi_script_name; include fastcgi_params;}

The other is to use sock files.

Location ~ .php ${root / usr/share/nginx/html; fastcgi_pass unix:/var/run/php-fpm/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params;}

At the beginning, it was configured with the first port 9000, but the php could not be parsed. After querying the php-fpm log, it was found that there was sock.

[17-Sep-2019 00:23:02] NOTICE: fpm is running Pid 5617 [17-Sep-2019 00:23:02] NOTICE: ready to handle connections [17-Sep-2019 00:23:02] NOTICE: systemd monitor interval set to 10000ms [17-Sep-2019 00:31:28] ERROR: An another FPM instance seems to already listen on / var/run/php5-fpm.sock [17-Sep-2019 00:31:28] ERROR: FPM initialization failed [17-Sep-2019 00:37:34] NOTICE: configuration file / etc/php5/fpm/php-fpm.conf test is successful

Then the second sock file interaction mode was used in the nginx configuration file, and it was found that the page could not be parsed.

Finally, find the / etc/php5/fpm/pool.d/www.conf configuration file and change the listen to 127.0.0.1

Change nginx back to port listening, and after restarting nginx and php-fpm, you can finally parse the php script.

Root@ubuntu:/usr/local/nginx# netstat-tlnActive Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 00 127.0.0.1 Proto Recv-Q Send-Q Local Address Foreign Address State tcp 9000 0.0.0.0 * LISTEN tcp 00 127.0.0.1 only servers 3306 0.0.0.0 * LISTEN tcp 0 0 0 LISTEN tcp 80 0 0 0 1 1 0 0 0 LISTEN tcp6 0 0:: 1 xargs kill 631: * LISTEN root@ubuntu:/usr/local/nginx# pgrep nginx | xargs kill-s 9root@ubuntu:/usr/local/nginx# vim conf/nginx.confroot@ubuntu:/usr/local/nginx# sbin/nginx root@ubuntu:/usr/local/nginx#

Nginx.conf profile

Server {listen 80; server_name localhost; root html; index index.php; location ~\ .php ${fastcgi_pass 127.0.0.1 server_name localhost; root html; index index.php; location 9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params;}

The / etc/php5/fpm/pool.d/www.conf file is modified:

; The address on which to accept FastCGI requests.; Valid syntaxes are:; 'ip.add.re.ss:port'-to listen on a TCP socket to a specific address on; a specific port;;' port'-to listen on a TCP socket to all addresses on a; specific port;;'/ path/to/unix/socket'-to listen on a unix socket. Note: This value is mandatory.listen = 127.0.0.1 9000

Read here, this "php 9000 port does not start how to solve" article has been introduced, want to master the knowledge of this article still need to practice and use to understand, if you want to know more about the article, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report