phpMyAdmin 在 RHEL 6 上的 nginx 和 php-fpm 上有问题

jml*_*kin 7 php nginx php-fpm

我们在Red Hat Linux 6 (RHEL)上使用 nginx 和 php-fpm 设置了 Web 服务器。这台机器已经安装了 WordPress,并且运行良好。我们已将 WordPress 设置为转到wptest.domain.local。然后,我们在启用了站点的名为servername.domain.local 的站点中创建了一个新站点,我们希望在其中托管各种工具。

PHP 始终运行良好,我们对 WordPress 没有任何问题。但是当尝试访问 phpMyAdmin 时,我们收到此错误:

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"

这是我们网站的配置:

    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;

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

    位置 = /favicon.ico {
        log_not_found 关闭;
        access_log off;
    }

    位置 = /robots.txt {
        允许所有;
        log_not_found 关闭;
        access_log off;
    }

    位置 ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        包括 /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 安装在/srv/www/servername/public_html/phpmyadmin/.

昨天我注意到它说 phpMyAdmin 也有一些 SEGFAULT 错误。

如果我在这个目录中放了一个phpinfo文件,它就可以正常工作。phpMyAdmin 中包含的phpinfo(有一个包含等)不起作用。

浏览器显示502 Bad Gateway

另外,通常在 php-fpm 重新启动后,我会看到一个红色框说phpmyadmin -error,然后无法正常启动会话,请检查您的 PHP 和/或网络服务器日志文件中给出的错误并正确配置您的 PHP 安装。我尝试启用 PHP 日志记录,但一无所获。

如果我去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"
Run Code Online (Sandbox Code Playgroud)

Mic*_*ton 10

从您发布的最新错误来看,PHP 似乎正在尝试将会话数据写入磁盘中实际上不可写的目录,即/var/lib/php/session.

检查此目录的所有权和权限:

ls -ld /var/lib/php/session
Run Code Online (Sandbox Code Playgroud)

将这些与运行 php-fpm 的用户和组 ID 进行比较。这些将在或 目录中的PHP-FPM 池配置中的user =group =声明中找到。/etc/php-fpm.conf/etc/php-fpm.d/