nginx configures php, you can see phpinfo, but cannot parse other php codes
黄黄滨
黄黄滨 2020-01-31 17:25:06
0
0
1336

I set up the lnmp environment on ubuntu, and there was a small problem when configuring nginx.
Create a test file in /etc/nginx/sites-available/

server {
listen 9090;
#listen [::]:9090;

server_name test.com;

large_client_header_buffers 4 16k;
client_max_body_size 300m;
client_body_buffer_size 128k;
proxy_connect_timeout 600; read_timeout 600;
proxy_send_timeout 600;
proxy_buffer_size 64k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;

root /var/www/test;
#index index.html index.php;
index index .html index.htm index.php;

location / {
try_files $uri $uri/ =404;
}
pass PHP scripts to FastCGI server

#LOCATION ~ \ .php $ {
#Include Snippets/Fastcgi-PHP.CONF;

p PHP-FPM (or Other Unix Sockets):
FASTCGI_PASS Unix:/V AR/ run/php/php7.0-fpm.sock;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
# concurs with nginx's one
# #location ~ /\.ht {
# deny all;

Access 127.0.0.1:9090/index.php, it will report GET http://127.0.0.1:9090/index.php net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)

In the nginx error.log log, there is

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"

黄黄滨
黄黄滨

reply all (0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!