nginx設定php,可以看到phpinfo,但是解析不了其他的php程式碼
黄黄滨
黄黄滨 2020-01-31 17:25:06
0
0
1326

我在ubuntu上搭建lnmp環境,在配置nginx的時候有個小問題。
在/etc/nginx/sites-available/建立一個test檔案

server {
listen 9090;
#listen [ test.com;

large_client_header_buffers 4 16k;
client_max_body_size 300m;# _timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;
)
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_wroot_size 6 #index index.html index.php;
index index .html index.htm index.php;

location / {
try_files $uri $uri/ =404;#
# location ~ \.php$ {
# include snippets/fastcgi-php.conf;
## c ):#
fastcgi_pass unix:/var/ run/php/php7.0-fpm.sock;
# # With php-cgi (or other tcp sockets):
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
















##1s # #location ~ /\.ht {
#location ~ /\.ht {
# deny all;
#}## T_FILENAME $document_root$fastcgi_script_name;

訪問127.0.0.1:9090/index.php,會報GET http://127.0.0.1:9090/index.php net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)


#########################################################################################

在nginx的error.log日誌中有

2020/01/31 17:11:55 [error] 15569#15569: *6 upstream timed out (110: Connection timed out) while reading upstream , client: 127.0.0.1, server: test.com, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock: ", host: "127.0.0.1:9090"

黄黄滨
黄黄滨

全部回覆 (0)
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!