nginx php
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server
删了proc方法
cat fastcgi.conf ==open_dir 注释
#fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/:/home/www/:/usr/local/bin:/home/www/cdspider2web:/root/.composer";
php.ini 注释
;open_basedir =/home/www/:/usr/local/bin:/home/www/cdspider2web:/root/.composer
- 在你php-fpm配置文件
php-fpm.conf
中设置security.limit_extensions
为.php
或.php5
,或者其他任何与你环境一致的后缀名。 对于开发环境下的一些用户来说, 完全移除所有security.limit_extensions
的值或设置为FALSE
,能够保证可以正常工作. - 在你的nginx配置文件中设置
fastcgi_pass
为你的socket
地址(e.g. unix:/var/run/php-fpm/php-fpm.sock;), 替代ip地址:端口
这种方式(127.0.0.1:9000). -
检查你的
SCRIPT_FILENAME
,fastcgi_param
并根据你文件的地址来设置它们. -
在你的nginx配置文件中包含有
fastcgi_split_path_info ^(.+\.php)(/.+)$
; 则所有其他的对应fastcgi参数也都应该在location块中定义;具体可参考phalcon的nginx官方配置 -
在你的
php.ini
配置文件中,设置cgi.fix_pathinfo=1
[root@iZ2zec03srb2lqozivryfpZ vhost]# cat cdspider2web.conf server { listen 8880; server_name 47.93.88.247; root "/home/www/cdspider2web/public"; index index.html index.htm index.php; charset utf-8; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } access_log off; error_log /home/wwwlogs/cdspider2web_error.log; sendfile off; client_max_body_size 100m; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors off; fastcgi_buffer_size 16k; #fastcgi_buffers 4 16k; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; } location ~ /\.ht { deny all; } }
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!