ubuntu php7.2 fpm-php 未监听9000端口问题
|
ubuntu查看端口命令 发现netstat -ap | grep 9000 什么都没有打印,说明9000端口没有 切换到/etc/php/7.2/fpm/pool.d 目录下 打开www.conf 看到这行listen = /run/php/php7.2-fpm.sock 将其改成 listen = 127.0.0.1:9000 让他监听本机9000端口 重启php-fpm服务 方法: 进入到/etc/init.d 目录下,执行./php7.2-fpm restart (可能安装的版本不一样,你这这里的php7.2-fpm名字可能不一样) 重启成功后netstat -ap | grep 9000发现有输出了。 如果用的nginx服务器,修改nginx配置。我的配置在/etc/nginx,打开nginx.conf 我的配置如下,你可能需要修改listen端口,server_name 参数,root存放路径 http { ## # Basic Settings ## sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; server { listen 8081; #安全组内端口,并且不和其他程序冲突 server_name 192.168.193.128; #服务器公网ip #charset koi8-r; #access_log logs/host.access.log main; #静态页面目录 默认为Nginx下的html文件夹 可配置成其他目录 绝对路径即可 root /home/gopath/src/GOSINT/website; # #默认首页 上面root路径下的文件 index index.php index.html index.htm; location ~ .php$ { try_files $uri /index.php =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^(.+.php)(/.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; include fastcgi_params; } }
(编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
