Last roadblock changing from Apache: SSL & PHP - SUCCESS!

Philip Rhoades phil at pricom.com.au
Mon May 15 00:34:54 UTC 2017


Steve,


On 2017-05-15 09:43, Steve Wilson wrote:
> Hi,
> 
> It doesn't look like that's actually getting passed to php-fpm.
> You're possibly missing the php handling in your server{} block.
> Check that you've got a location set for php files to do a 
> fastcgi_pass.


Isn't that what this does?:

upstream php {
     server unix:/run/php-fpm/www.sock ;
}

server {
.
.
         fastcgi_pass php;
         }
}


> eg.
> location ~ \.php$ {
>                 fastcgi_pass   unix:/var/run/php-fpm/sock;
>                 fastcgi_index  index.php;
>                 fastcgi_param  SCRIPT_FILENAME
> $document_root$fastcgi_script_name;
>                 client_body_timeout 300;
>                 include /etc/nginx/fastcgi_params;
>         }
> 
> The above is from one of my roundcube instances and makes sure that php
> files are processed by php.


Yes!  I added that one line:

   fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

and it started working!

Many thanks!

Regards,

Phil.


> Steve
> 
> On 14/05/2017 23:43, Philip Rhoades wrote:
>> People,
>> 
>> If I can solve this last problem (that I have just spent all night 
>> on),
>> I can completely replace Apache with Nginx.  I am using RoundCubeMail 
>> as
>> my Webmail client - it is written in PHP (the only PHP thing on my
>> server) but it has been working happily with Apache for many years.  I
>> have RCM in an SSL protected directory:
>> 
>>   /home/ssl/webmail
>> 
>> When I couldn't get that working I tried testing the setup with a 
>> simple:
>> 
>>   /home/ssl/index.php
>> 
>> file that outputs PHP info (attached) - but I had exactly the same
>> problem with that - a blank screen except for a green block cursor in
>> the bottom right of the screen ie no text output in the browser and no
>> errors in any of the logs.
>> 
>> I also attach:
>> 
>>   /etc/nginx/conf.d/php-fpm.conf
>> 
>> and:
>> 
>>   /etc/php-fpm.d/www.conf
>> 
>> I would _really_ appreciate it if anyone could tell me what is wrong
>> with my configuration . . (running on Fedora 25 x86_64).
>> 
>> Thanks,
>> 
>> Phil.
>> 
>> 
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>> 
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

-- 
Philip Rhoades

PO Box 896
Cowra  NSW  2794
Australia
E-mail:  phil at pricom.com.au


More information about the nginx mailing list