Question
Can't figure out Nginx PHP
I’ve been scouring through all the nginx, Wordpress, PHP threads but I can’t seem to get what I need. I have a Ghost blog installed (working fine) and am trying to add a Wordpress along side it. The Wordpress block looks like:
server {
listen 80;
listen [::]:80;
root /var/www/html;
index index.php index.html index.htm;
server_name wpdomain.com;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}
I’ve tried the alternative:
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
with the appropriate listen
adjustment to no avail.
The status looks fine:
php7.2-fpm.service - The PHP 7.2 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php7.2-fpm.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2018-02-22 00:22:56 UTC; 6min ago
Docs: man:php-fpm7.2(8)
Main PID: 22063 (php-fpm7.2)
Status: "Processes active: 0, idle: 2, Requests: 6, slow: 0, Traffic: 0req/sec"
Tasks: 3
Memory: 11.4M
CPU: 68ms
CGroup: /system.slice/php7.2-fpm.service
├─22063 php-fpm: master process (/etc/php/7.2/fpm/php-fpm.conf)
├─22066 php-fpm: pool www
└─22067 php-fpm: pool www
and I can access the non-php files just fine, but I can’t setup Wordpress until I can actually access the PHP. I’m not seeing errors in /var/log/nginx/error.log
either, I’m not sure what else to check at this point…
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×