Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

We have a web server setup with nginx and php-fpm on RHEL6. 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, we have no 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 sites config:

    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 get 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"

share|improve this question
1  
PHP threw an error. Make sure you're logging them somewhere (see /etc/php.ini), and then go see what it is. –  Michael Hampton Sep 14 '12 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 Sep 16 '12 at 1:37
    
I enabled logging, and restarted nginx, but it never actually wrote anything to the log file. –  jmlumpkin Sep 18 '12 at 12:10

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
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 Sep 18 '12 at 12:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.