I've just recently installed Nginx 1.8 and PHP7 on my server trying to make it serve my application.
When I make my webroot folder index file an HTML file which just returns Hey
, then I can see the page loaded with that text.
However, when I try to replace that index.html
file with index.php
file I just see a blank page and no errors being spat.
I tried to look into /var/log/nginx/access.log
and /var/log/nginx/error.log
as-well as my site error log: /var/log/nginx/my-website-error.log
. Couldn't find any error there.
I tried to maybe look at the PHP7.0-FPM error log found at /var/log/php7.0-fpm.log
but nothing there as-well.
I made sure to edit my /etc/php/7.0/fpm/php.ini
file and set display_erorrs = On
and error_reporting=E_ALL
.
I still can't see any error and I can't execute any PHP code.
My Nginx config file which passes the php execution to FPM looks like:
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
Any idea what's going on?
Try to add fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
before including the params file. This parameter defines the script that php should execute.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.