The nginx WordPress installation

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Recently in WordPress, then the environment is centOS6.3, use the nginx web server.

After a series of installation, nginx, mysql, PHP were installed successfully, and then configure nginx access WordPress, anyway have problems.

Question 1: access file 404

Question 2: access static HTML pages is no problem, but access PHP file tip 502 problems

3:Your PHP installation appears to be missing the MySQL extension which is required by WordPress. (your PHP like almost no installation necessary to run WordPress MySQL extension)

Question 4: access to the HTML static page no problem, install.php is not a problem, the login page is not a problem, but after login but tip 403

Question 5: install the theme, suggesting that Unable to create directory wp-content/uploads/xxxx/xxx.

To solve the first problem, because the root address error, or no conf file is configured correctly, before has changed is the /etc/nginx/nginx.conf, but always not, directly behind to change the /etc/nginx/conf.d/default.conf file, as like can be, estimation is in front of me modify the problem, no matter, anyway now is right the.

To solve the second problems, mainly because the php-fpm port, copy online tutorial configuration, he gave the port is 53217, did not notice it, and then make a half day, back into the 9000 port default it.

To solve third problems, first, to see whether they have installed a php-mysql extension, input the command "rpm -qa|grep -i PHP", have a look whether less php-mysql, if not, then "Yum install php-mysql" installation. If there is, to see the content of solving.

Solving the fourth problem is the location index is not specified´╝ü

The original solution:

The follow-up will be posted my specific nginx configuration.

The fifth problem is because the directory or authority, or bug?

Solution: in the wp-content/ directory, uploads directory, and then raise the uploads directory permissions.

mkdir /var/www/wordpresss/wp-content/uploads
chmod 777 -R /var/www/wordpress/wp-content/uploads

The original solution:

The following posted my configuration file /etc/nginx/conf.d/default.conf code.

listen       80;
	root		/usr/local/web/;
    location / {
        index  index.html index.htm;
	location /wordpress/ {
        index  index.php;
        try_files $uri $uri//wordpress/index.php?$args;
	location ~ \.php$ {
		include        fastcgi_params;
		fastcgi_pass   localhost:9000;
		fastcgi_param  SCRIPT_FILENAME  /usr/local/web/$fastcgi_script_name;


Question 2: access static HTML no problem, but the access PHP file tip 502 problems
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Tom at January 05, 2014 - 9:53 PM