nginx reload报错:[error] open() “/tmp/nginx.pid“ failed

本文介绍了一种常见的nginx错误——在尝试重新加载配置时出现的文件不存在错误,并提供了一个简单的解决方案:通过指定nginx配置文件路径来启动nginx。
[root@yfw ~]# cd /www/wwwroot/szrengjing.com/chat/dist [root@yfw dist]# curl -I https://szrengjing.com/chat/index.html --http1.1 --insecure curl: (52) Empty reply from server [root@yfw dist]# openssl s_client -connect szrengjing.com:443 -servername szrengjing.com -quiet depth=2 C = US, O = Internet Security Research Group, CN = ISRG Root X1 verify return:1 depth=1 C = US, O = Let's Encrypt, CN = R13 verify return:1 depth=0 CN = szrengjing.com verify return:1 ^C [root@yfw dist]# ls -l /www/server/panel/vhost/cert/szrengjing.com/ total 8 -rw------- 1 root root 3587 Oct 30 07:44 fullchain.pem -rw------- 1 root root 1703 Oct 30 07:44 privkey.pem [root@yfw dist]# tail -f /www/wwwlogs/szrengjing.com.error.log 2025/11/11 15:22:27 [error] 1187603#0: *722977 FastCGI sent in stderr: "PHP message: PHP Warning: file_get_contents(/www/wwwroot/szrengjing.com/themes/dianpu1/library/member_info.lbi): failed to open stream: No such file or directory in /www/wwwroot/szrengjing.com/includes/cls_template.php on line 165" while reading response header from upstream, client: 144.76.32.114, server: szrengjing.com, request: "GET /supplier.php?go=category&suppId=5&id=43&brand=&price_min=&price_max=&page=&sort=last_update&order=ASC HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi-53.sock:", host: "szrengjing.com" 2025/11/11 15:22:34 [error] 1187603#0: *722977 FastCGI sent in stderr: "PHP message: PHP Warning: file_get_contents(/www/wwwroot/szrengjing.com/themes/dianpu1/library/member_info.lbi): failed to open stream: No such file or directory in /www/wwwroot/szrengjing.com/includes/cls_template.php on line 165" while reading response header from upstream, client: 144.76.32.114, server: szrengjing.com, request: "GET /supplier.php?go=category&suppId=5&id=44&brand=&price_min=&price_max=&page=&sort=last_update&order=ASC HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi-53.sock:", host: "szrengjing.com" 2025/11/11 15:22:43 [error] 1187603#0: *722977 FastCGI sent in stderr: "PHP message: PHP Warning: file_get_contents(/www/wwwroot/szrengjing.com/themes/dianpu1/library/member_info.lbi): failed to open stream: No such file or directory in /www/wwwroot/szrengjing.com/includes/cls_template.php on line 165" while reading response header from upstream, client: 144.76.32.114, server: szrengjing.com, request: "GET /supplier.php?go=category&suppId=5&id=45&brand=&price_min=&price_max=&page=&sort=last_update&order=ASC HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi-53.sock:", host: "szrengjing.com" 2025/11/11 15:22:49 [error] 1187603#0: *722977 FastCGI sent in stderr: "PHP message: PHP Warning: file_get_contents(/www/wwwroot/szrengjing.com/themes/dianpu1/library/member_info.lbi): failed to open stream: No such file or directory in /www/wwwroot/szrengjing.com/includes/cls_template.php on line 165" while reading response header from upstream, client: 144.76.32.114, server: szrengjing.com, request: "GET /supplier.php?go=category&suppId=5&id=46&brand=&price_min=&price_max=&page=&sort=last_update&order=ASC HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi-53.sock:", host: "szrengjing.com" 2025/11/11 15:33:03 [error] 1187603#0: *735443 FastCGI sent in stderr: "PHP message: PHP Warning: file_get_contents(/www/wwwroot/szrengjing.com/themes/dianpu1/library/member_info.lbi): failed to open stream: No such file or directory in /www/wwwroot/szrengjing.com/includes/cls_template.php on line 165" while reading response header from upstream, client: 66.249.66.33, server: szrengjing.com, request: "GET /supplier.php?go=category&suppId=5&id=19 HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi-53.sock:", host: "szrengjing.com" 2025/11/11 20:41:30 [error] 1187603#0: *807976 FastCGI sent in stderr: "PHP message: PHP Notice: Constant ADMIN_PATH already defined in /www/wwwroot/szrengjing.com/data/config.php on line 29" while reading response header from upstream, client: 85.208.96.208, server: szrengjing.com, request: "GET /supplier/ HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi-53.sock:", host: "szrengjing.com" 2025/11/11 20:41:33 [error] 1187603#0: *807983 FastCGI sent in stderr: "PHP message: PHP Notice: Constant ADMIN_PATH already defined in /www/wwwroot/szrengjing.com/data/config.php on line 29" while reading response header from upstream, client: 85.208.96.208, server: szrengjing.com, request: "GET /supplier/privilege.php?act=login HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi-53.sock:", host: "szrengjing.com" 2025/11/11 21:28:29 [error] 1187603#0: *818561 FastCGI sent in stderr: "PHP message: PHP Notice: Constant ADMIN_PATH already defined in /www/wwwroot/szrengjing.com/data/config.php on line 29" while reading response header from upstream, client: 183.7.149.88, server: szrengjing.com, request: "GET /supplier/ HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi-53.sock:", host: "szrengjing.com", referrer: "https://szrengjing.com/apply_index.php" 2025/11/11 21:28:29 [error] 1187603#0: *818567 FastCGI sent in stderr: "PHP message: PHP Notice: Constant ADMIN_PATH already defined in /www/wwwroot/szrengjing.com/data/config.php on line 29" while reading response header from upstream, client: 27.46.125.46, server: szrengjing.com, request: "GET /supplier/privilege.php?act=login HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi-53.sock:", host: "szrengjing.com", referrer: "https://szrengjing.com/apply_index.php" 2025/11/11 21:46:28 [error] 1187603#0: *821544 open() "/www/wwwroot/szrengjing.com/.well-known/traffic-advice" failed (2: No such file or directory), client: 66.249.81.132, server: szrengjing.com, request: "GET /.well-known/traffic-advice HTTP/1.1", host: "szrengjing.com"
11-12
user www www; worker_processes auto; error_log /www/wwwlogs/nginx_error.log crit; pid /www/server/nginx/logs/nginx.pid; worker_rlimit_nofile 100000; stream { log_format tcp_format '$time_local|$remote_addr|$protocol|$status|$bytes_sent|$bytes_received|$session_time|$upstream_addr|$upstream_bytes_sent|$upstream_bytes_received|$upstream_connect_time'; access_log /www/wwwlogs/tcp-access.log tcp_format; error_log /www/wwwlogs/tcp-error.log; include /www/server/panel/vhost/nginx/tcp/*.conf; } events { use epoll; worker_connections 51200; multi_accept on; } http { include mime.types; types { application/font-sfnt ttf; font/truetype ttf; font/opentype otf; application/font-woff woff; application/font-woff2 woff2; } default_type application/font-sfnt; #include luawaf.conf; include proxy.conf; default_type application/octet-stream; server_names_hash_bucket_size 512; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 300m; sendfile on; tcp_nopush on; keepalive_timeout 60; tcp_nodelay on; fastcgi_connect_timeout 3000; fastcgi_send_timeout 3000; fastcgi_read_timeout 3000; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 256k; fastcgi_intercept_errors on; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.1; gzip_comp_level 2; gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml; gzip_vary on; gzip_proxied expired no-cache no-store private auth; gzip_disable "MSIE [1-6]\."; limit_conn_zone $binary_remote_addr zone=perip:10m; limit_conn_zone $server_name zone=perserver:10m; server_tokens off; access_log off; server { listen 888; server_name phpmyadmin; index index.html index.htm index.php; root /www/server/phpmyadmin; location ~ /tmp/ { return 403; } #error_page 404 /404.html; include enable-php.conf; location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } # 修正后的字体配置块 location ~* \.(ttf|otf|woff2?)$ { # 在开头添加 access_log /www/wwwlogs/font_access.log; error_log /www/wwwlogs/font_error.log; # ... 其他配置 ... root /www/wwwroot/yinzhang.jinshelby.com; rewrite ^/xcx/font/(.*)$ /public/xcx/font/$ 1 break; # 关键 MIME 类型 types {} default_type application/font-sfnt; # CORS 头 add_header Access-Control-Allow-Origin * always; add_header Access-Control-Allow-Methods 'GET, OPTIONS' always; add_header Access-Control-Allow-Headers 'Range' always; add_header Access-Control-Expose-Headers 'Content-Length,Content-Range' always; # 缓存 expires 1y; add_header Cache-Control "public, max-age=31536000, immutable"; # 字节范围支持(安卓必需) add_header Accept-Ranges bytes; if ($ request_method = 'OPTIONS') { return 204; } } location ~ .*\.(js|css)?$ { expires 12h; } location ~ /\. { deny all; } access_log /www/wwwlogs/access.log; } include /www/server/panel/vhost/nginx/*.conf; } 现在完整配置按照你说的是这样的 , 但是保存报错: nginx version: nginx/1.20.2 nginx: [warn] duplicate extension "ttf", content type: "font/truetype", previous content type: "application/font-sfnt" in /www/server/nginx/conf/nginx.conf:27 nginx: [warn] duplicate extension "woff", content type: "application/font-woff", previous content type: "font/woff" in /www/server/nginx/conf/nginx.conf:29 nginx: [warn] duplicate extension "woff2", content type: "application/font-woff2", previous content type: "font/woff2" in /www/server/nginx/conf/nginx.conf:30 nginx: [emerg] "default_type" directive is duplicate in /www/server/nginx/conf/nginx.conf:37 nginx: configuration file /www/server/nginx/conf/nginx.conf test failed
07-05
[root@yfw yfw_szrengjing_com]# sudo systemctl status wp-im-server ● wp-im-server.service - WordPress IM WebSocket Server Loaded: loaded (/etc/systemd/system/wp-im-server.service; disabled; vendor preset: disabled) Active: active (running) since Thu 2025-11-13 17:49:02 CST; 3h 57min ago Main PID: 404867 (php) Tasks: 2 (limit: 23712) Memory: 25.6M CGroup: /system.slice/wp-im-server.service ├─404867 WorkerMan: master process start_file=/www/wwwroot/yfw_szrengjing_com/wp-content/plug> └─404868 WorkerMan: worker process none websocket://0.0.0.0:2121 Nov 13 17:49:02 yfw.szrengjing.com systemd[1]: Starting WordPress IM Server (Workerman)... Nov 13 17:49:02 yfw.szrengjing.com systemd[1]: wp-im-server.service: Can't open PID file /tmp/wp-im-serve> Nov 13 17:49:02 yfw.szrengjing.com systemd[1]: Started WordPress IM Server (Workerman). [root@yfw yfw_szrengjing_com]# sudo systemctl status wp-im-server ● wp-im-server.service - WordPress IM WebSocket Server Loaded: loaded (/etc/systemd/system/wp-im-server.service; disabled; vendor preset: disabled) Active: active (running) since Thu 2025-11-13 17:49:02 CST; 3h 58min ago Main PID: 404867 (php) Tasks: 2 (limit: 23712) Memory: 25.6M CGroup: /system.slice/wp-im-server.service ├─404867 WorkerMan: master process start_file=/www/wwwroot/yfw_szrengjing_com/wp-content/plug> └─404868 WorkerMan: worker process none websocket://0.0.0.0:2121 Nov 13 17:49:02 yfw.szrengjing.com systemd[1]: Starting WordPress IM Server (Workerman)... Nov 13 17:49:02 yfw.szrengjing.com systemd[1]: wp-im-server.service: Can't open PID file /tmp/wp-im-serve> Nov 13 17:49:02 yfw.szrengjing.com systemd[1]: Started WordPress IM Server (Workerman). lines 1-13/13 (END)...skipping... ● wp-im-server.service - WordPress IM WebSocket Server Loaded: loaded (/etc/systemd/system/wp-im-server.service; disabled; vendor preset: disabled) Active: active (running) since Thu 2025-11-13 17:49:02 CST; 3h 58min ago Main PID: 404867 (php) Tasks: 2 (limit: 23712) Memory: 25.6M CGroup: /system.slice/wp-im-server.service ├─404867 WorkerMan: master process start_file=/www/wwwroot/yfw_szrengjing_com/wp-content/plug> └─404868 WorkerMan: worker process none websocket://0.0.0.0:2121 Nov 13 17:49:02 yfw.szrengjing.com systemd[1]: Starting WordPress IM Server (Workerman)... Nov 13 17:49:02 yfw.szrengjing.com systemd[1]: wp-im-server.service: Can't open PID file /tmp/wp-im-serve> Nov 13 17:49:02 yfw.szrengjing.com systemd[1]: Started WordPress IM Server (Workerman). ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ lines 1-13/13 (END)
最新发布
11-14
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值