Nginx 1.14 + php7.3-fpm
На Ubuntu 18.04 поставил Nginx 1.14.2, по инструкции с официального сайта. Поставил php7.3-fpm из репы ondrej/php. В /etc/php/7.3/fpm/pool.d/www.conf изменил listen = /run/php/php7.3-fpm.sock на listen = 127.0.0.1:9000, в nginx.conf изменил пользователя на www-data (как у php-fpm). Изменил default.conf на:
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
}
root@abcde:/# netstat -anp | grep 9000
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 11868/php-fpm: mast
root@abcde:/# ps -aux | grep php
root 11868 0.0 10.9 384300 25752 ? Ss 14:05 0:00 php-fpm: master process (/etc/php/7.3/fpm/php-fpm.conf)
www-data 11869 0.0 5.0 386600 11920 ? S 14:05 0:00 php-fpm: pool www
www-data 11870 0.0 5.7 386732 13528 ? S 14:05 0:00 php-fpm: pool www
root 11875 0.0 0.4 14428 1104 pts/1 S+ 14:08 0:00 grep --color=auto php
root@abcde:/# ps -aux | grep nginx
root 11862 0.0 0.3 33308 896 ? Ss 14:05 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
www-data 11864 0.0 1.8 38108 4248 ? S 14:05 0:00 nginx: worker process
root 11877 0.0 0.4 14428 1084 pts/1 S+ 14:08 0:00 grep --color=auto nginx
<?php
echo "Hello World!";
?>
<?php var_export($_SERVER)?>
2018/12/29 13:56:16 [error] 11838#11838: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 100.100.1.1, server: localhost, request: "GET /test.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "111.111.222.222"