Welcome! Log In Create A New Profile

Advanced

connection issue php-fpm and nginx

Posted by RogerSilva 
connection issue php-fpm and nginx
September 08, 2014 02:14PM
Hi all, How are you?

I am trying to setup a new environment with the following characteristics:
* CentOS version 6.5 (64 bits);
* Nginx version 1.6.1;
* PHP-fpm version 5.3.3-27;
* PHP version 5.3.3;
* Mysql version 5.1.73;

This is my /etc/nginx/conf.d/default.conf file:
------------------start default.conf
server {
listen 80;
server_name localhost;

root /usr/share/nginx/html;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
}

index index.html index.htm index.php default.php;

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
}

------------------end default.conf

This is small part of /etc/php-fpm.d/www.conf concerned with nginx:
------------------start www.conf
[www]
listen = /var/run/php-fpm.socket
listen.owner = nginx
listen.group = nginx
listen.mode = 0666
user = nginx
group = nginx
pm.status_path = /status
------------------start www.conf

I have created a index.php page at /usr/share/nginx/html folder with the following content:
------------------start index.php
<?php
phpinfo();
?>
------------------start index.php

The issue is that when I try to access http://localhost/info.php thus nginx provides me info.php source code.
I mean, when I try to access http://localhost/info.php then nginx pushes info.php source code without any further processing.
Therefore, It looks like that there is a configuration problem between nginx and PHP-fpm, but I can not figure out what is going on.
It is also important to note that nginx and PHP-fpm errors logs does not registry any kind of error/issue.

Please, May someone help me?I have no idea of what is going on.

I appreciate any help you can give me,
Roger
Re: connection issue php-fpm and nginx
September 08, 2014 05:06PM
Please...anyone?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 300
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready