Welcome! Log In Create A New Profile

Advanced

Using php-fpm to serve a wordpress blog.

Posted by qaswm 
Using php-fpm to serve a wordpress blog.
September 16, 2013 10:14AM
Hello,

I am trying to serve a wordpress blog with nginx and used the following commands to setup the server.


sudo apt-get update
sudo apt-get install mysql-server php5-fpm nginx
sudo service nginx start

sudo nano /etc/php5/fpm/php.ini
Find the line, cgi.fix_pathinfo=1, and change the 1 to 0.
cgi.fix_pathinfo=0

sudo service php5-fpm restart

sudo nano /etc/nginx/sites-available/default
server {
listen 80;


root /usr/share/nginx/www;
index index.php index.html index.htm;

server_name example.com;

location / {
try_files $uri $uri/ /index.html;
}

error_page 404 /404.html;

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

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;

}

}

sudo nano /etc/php5/fpm/pool.d/www.conf
replace "listen = 127.0.0.1:9000" with "listen = /var/run/php5-fpm.sock;"

sudo service nginx restart
sudo service php5-fpm restart

Now I am trying to use a word press plugin and it seems to be causing an error.

11161#0: *1 FastCGI sent in stderr: "PHP message: PHP Warning: gzinflate(): data error in /usr/share/nginx/www/wp-content/plugins/fb-linkedin-resume/fb-linkedin-resume.php on line 111" while reading upstream, client: xx.xx.xx.xx, server: servername.com, request: "GET /index.php/somepage/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "servername.com", referrer: "http://servername.com/"

What do i need to change to resolve this issue?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 54
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready