Unable to see a php page

Ian Hobson hobson42 at gmail.com
Mon Mar 16 15:12:46 UTC 2020

On 15/03/2020 14:00, Francis Daly wrote:
> On Sun, Mar 15, 2020 at 05:19:57PM +0330, Mahmood Naderan wrote:
> Hi there,
>> I started php-fpm and opened localhost/index.php
>> This time I see the content of index.php as a plain text.
>> I have to do more debugging. Thanks.
> That's useful.
> I suggest that the first step is to look at the http headers returned
> from your request -- if they include something like "X-Powered-By: php",
> then you can be confident that nginx asked php to process the file (and
> further investigation should be on the php side); if they do not, then
> you should probably check the nginx side (and the error log, possibly
> in debug mode for the test), to see what nginx did with the request that
> involved it *not* making the fastcgi_pass request.
> Good luck with it,

The thing I notice is that you have two root statements.
You only need the one at the /server level.

Then, if you use the line

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

(That is all on one line).
in the localtion clause, things should work.

Ian Hobson

This email has been checked for viruses by AVG.

More information about the nginx mailing list