7

We have a web server setup with nginx and php-fpm on Red Hat Linux 6 (RHEL). This machine already has WordPress installed, and it runs great. We have WordPress set up to go to wptest.domain.local. We then created a new site in sites-enabled called servername.domain.local, where we wanted to host various tools.

PHP works fine throughout, and we don't have any issues with WordPress. But when trying to reach phpMyAdmin, we get this error:

2012/09/14 16:22:13 [error] 10065#0: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.1.15, server: servername, request: "GET /phpmyadmin/setup/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "servername"

And here is our site's configuration:

    server_name servername severname.domain.local;
    access_log /srv/www/severname/logs/access.log;
    error_log /srv/www/severname/logs/error.log;
    root /srv/www/severname/public_html;

    location / {
        index index.html index.htm index.php;
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include /etc/nginx/fastcgi_params;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /srv/www/severname/public_html$fastcgi_script_name;
    }

PHPmyadmin is installed at /srv/www/servername/public_html/phpmyadmin/.

Yesterday I noticed it said there were some SEGFAULT errors too from phpMyAdmin.

If I put a phpinfo file in this directory, it works fine. The phpinfo included in phpMyAdmin (which has an include, etc.) doesn't work.

The browser displays a 502 Bad Gateway.

Also, usually after a php-fpm restart, I will see a red box saying phpmyadmin -error, then cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. I tried enabling PHP logging, but I got nothing.

I do get this in my error log for the site if I go to phpmyadmin/setup:

2012/09/18 08:12:43 [error] 16722#0: *22 FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: open(/var/lib/php/session/sess_5d9vhk4jv1f07v2jsltlnp8tdnp7s167, O_RDWR) failed: Permission denied (13) in Unknown on line 0
PHP message: PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0" while reading upstream, client: 192.168.1.11, server: servername, request: "GET /phpmyadmin/setup/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "servername"
3
  • 1
    PHP threw an error. Make sure you're logging them somewhere (see /etc/php.ini), and then go see what it is. Commented Sep 14, 2012 at 21:04
  • I won't be able to get back on the machine until Monday but will turn on PHP logging then. Would that be more helpful than the php-fpm logs? I couldn't get anything out of them.
    – jmlumpkin
    Commented Sep 16, 2012 at 1:37
  • I enabled logging, and restarted nginx, but it never actually wrote anything to the log file.
    – jmlumpkin
    Commented Sep 18, 2012 at 12:10

1 Answer 1

10

From the latest error you posted, it appears that PHP is trying to write session data to disk in a directory that's not actually writable, namely /var/lib/php/session.

Check the ownership and permissions on this directory:

ls -ld /var/lib/php/session

Compare these to the user and group ID under which php-fpm is running. These will be found in the user = and group = declarations in PHP-FPM's pool configuration in /etc/php-fpm.conf or files in the /etc/php-fpm.d/ directory.

1
  • This was actually it (fixed it before seeing this posted). A sys admin installed Apache on here, which screwed up our nginx setup. When I fixed the nginx permissions recently, it actually broke this, because it was expecting an apache user.
    – jmlumpkin
    Commented Sep 18, 2012 at 12:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .