【问题标题】:phpMyAdmin can't run on CentOS 6.5 with PHP5.5.8phpMyAdmin 无法在带有 PHP5.5.8 的 CentOS 6.5 上运行
【发布时间】:2014-02-11 06:21:55
【问题描述】:

我有一个运行 nginx 1.0.15、PHP (FPM/FastCGI) 5.5.8 和 MySQL 5.5.35 的 CentOS 6.5 x64 服务器。

我已经安装了 phpMyAdmin 4.1.5 并配置了一个带有 html_root 的 nginx 虚拟主机,该 html_root 通过符号链接链接到 phpMyAdmin 的目录。

我的问题是,当我打开地址 (https://172.28.65.80:8060) 时,我从 phpMyAdmin 收到此错误:

Fatal error: Call to undefined function __() in /usr/share/phpMyAdmin/libraries/core.lib.php on line 229

我做错了什么?

编辑:

如果我尝试使用 php(不是 php-fpm)从控制台运行 phpMyAdmin,它会说:

# php /usr/share/phpMyAdmin/index.php

Warning: require(./libraries/Error_Handler.class.php): failed to open stream: No such file or directory in /usr/share/phpMyAdmin/libraries/common.inc.php on line 57

Fatal error: require(): Failed opening required './libraries/Error_Handler.class.php' (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/phpMyAdmin/libraries/common.inc.php on line 57

显然Error_Handler.class.php 正确存储在/usr/share/phpMyAdmin/libraries/

编辑2:

这是phpMyAdmin使用的虚拟主机的配置:

#
# HTTPS phpmyadmin virtual host configuration
#

server {
    listen       8060;
    server_name  172.28.65.80;

    ssl                  on;
    ssl_certificate      /root/rootCA.pem;
    ssl_certificate_key  /root/rootCA.key;

    ssl_session_timeout  5m;

    ssl_protocols  SSLv2 SSLv3 TLSv1;
    ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers   on;

    location / {
        root   /usr/share/phpMyAdmin;
        index  index.php;
    }

    location ~ \.php$ {
         root           /usr/share/phpMyAdmin;
         fastcgi_pass   unix:/var/run/php-fpm.sock;
         fastcgi_index  index.php;
         fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
         include        fastcgi_params;
    }

}

编辑3:

这些是 phpMyAdmin 文件的权限:

# ll
total 692
-rw-r--r--.  1 nginx nginx  1569 Jan 17 14:21 browse_foreigners.php
-rw-r--r--.  1 nginx nginx  4829 Jan 17 14:21 changelog.php
-rw-r--r--.  1 nginx nginx   308 Jan 17 14:21 chk_rel.php
-rw-r--r--.  1 nginx nginx   852 Jan 17 14:21 composer.json
-rwxr-xr-x.  1 nginx nginx  4236 Jan 23 15:18 config.inc.php
-rw-r--r--.  1 nginx nginx  4236 Jan 17 14:21 config.sample.inc.php
-rw-r--r--.  1 nginx nginx  4178 Jan 17 14:21 db_create.php
-rw-r--r--.  1 nginx nginx  8870 Jan 17 14:21 db_datadict.php
-rw-r--r--.  1 nginx nginx   401 Jan 17 14:21 db_events.php
-rw-r--r--.  1 nginx nginx  2788 Jan 17 14:21 db_export.php
-rw-r--r--.  1 nginx nginx   505 Jan 17 14:21 db_import.php
-rw-r--r--.  1 nginx nginx  9297 Jan 17 14:21 db_operations.php
-rw-r--r--.  1 nginx nginx  5269 Jan 17 14:21 db_printview.php
-rw-r--r--.  1 nginx nginx  1987 Jan 17 14:21 db_qbe.php
-rw-r--r--.  1 nginx nginx   454 Jan 17 14:21 db_routines.php
-rw-r--r--.  1 nginx nginx  1636 Jan 17 14:21 db_search.php
-rw-r--r--.  1 nginx nginx   872 Jan 17 14:21 db_sql.php
-rw-r--r--.  1 nginx nginx  9465 Jan 17 14:21 db_structure.php
-rw-r--r--.  1 nginx nginx  8277 Jan 17 14:21 db_tracking.php
-rw-r--r--.  1 nginx nginx   364 Jan 17 14:21 db_triggers.php
drwxr-xr-x.  5 nginx nginx  4096 Jan 23 15:00 doc
-rw-r--r--.  1 nginx nginx  3122 Jan 17 14:21 error_report.php
drwxr-xr-x.  2 nginx nginx  4096 Jan 23 15:00 examples
-rw-r--r--.  1 nginx nginx 37639 Jan 17 14:21 export.php
-rw-r--r--.  1 nginx nginx 18902 Jan 17 14:21 favicon.ico
-rw-r--r--.  1 nginx nginx  2143 Jan 17 14:21 file_echo.php
-rw-r--r--.  1 nginx nginx 15581 Jan 17 14:21 gis_data_editor.php
-rw-r--r--.  1 nginx nginx 21171 Jan 17 14:21 import.php
-rw-r--r--.  1 nginx nginx  2679 Jan 17 14:21 import_status.php
-rw-r--r--.  1 nginx nginx 19846 Jan 17 14:21 index.php
drwxr-xr-x.  9 nginx nginx  4096 Jan 23 15:00 js
drwxr-xr-x. 13 nginx nginx 12288 Jan 23 15:00 libraries
-rw-r--r--.  1 nginx nginx   728 Jan 17 14:21 license.php
drwxr-xr-x. 42 nginx nginx  4096 Jan 23 15:00 locale
-rw-r--r--.  1 nginx nginx  1988 Jan 17 14:21 navigation.php
-rw-r--r--.  1 nginx nginx   389 Jan 17 14:21 phpinfo.php
-rw-r--r--.  1 nginx nginx   746 Jan 17 14:21 phpmyadmin.css.php
-rw-r--r--.  1 nginx nginx  1808 Jan 17 14:21 phpunit.xml.nocoverage
-rw-r--r--.  1 nginx nginx  2051 Jan 17 14:21 pmd_display_field.php
-rw-r--r--.  1 nginx nginx 36692 Jan 17 14:21 pmd_general.php
-rw-r--r--.  1 nginx nginx  5081 Jan 17 14:21 pmd_pdf.php
-rw-r--r--.  1 nginx nginx  4560 Jan 17 14:21 pmd_relation_new.php
-rw-r--r--.  1 nginx nginx  2194 Jan 17 14:21 pmd_relation_upd.php
-rw-r--r--.  1 nginx nginx  2589 Jan 17 14:21 pmd_save_pos.php
-rw-r--r--.  1 nginx nginx  2594 Jan 17 14:21 prefs_forms.php
-rw-r--r--.  1 nginx nginx 14308 Jan 17 14:21 prefs_manage.php
-rw-r--r--.  1 nginx nginx  1213 Jan 17 14:21 print.css
-rw-r--r--.  1 nginx nginx  6222 Jan 17 14:21 querywindow.php
-rw-r--r--.  1 nginx nginx  4004 Jan 17 14:21 schema_edit.php
-rw-r--r--.  1 nginx nginx  1734 Jan 17 14:21 schema_export.php
-rw-r--r--.  1 nginx nginx  1075 Jan 17 14:21 server_binlog.php
-rw-r--r--.  1 nginx nginx   735 Jan 17 14:21 server_collations.php
-rw-r--r--.  1 nginx nginx  2634 Jan 17 14:21 server_databases.php
-rw-r--r--.  1 nginx nginx   615 Jan 17 14:21 server_engines.php
-rw-r--r--.  1 nginx nginx   698 Jan 17 14:21 server_export.php
-rw-r--r--.  1 nginx nginx   452 Jan 17 14:21 server_import.php
-rw-r--r--.  1 nginx nginx  1465 Jan 17 14:21 server_plugins.php
-rw-r--r--.  1 nginx nginx 11668 Jan 17 14:21 server_privileges.php
-rw-r--r--.  1 nginx nginx  2054 Jan 17 14:21 server_replication.php
-rw-r--r--.  1 nginx nginx   577 Jan 17 14:21 server_sql.php
-rw-r--r--.  1 nginx nginx   889 Jan 17 14:21 server_status_advisor.php
-rw-r--r--.  1 nginx nginx  3538 Jan 17 14:21 server_status_monitor.php
-rw-r--r--.  1 nginx nginx  1369 Jan 17 14:21 server_status.php
-rw-r--r--.  1 nginx nginx  1663 Jan 17 14:21 server_status_queries.php
-rw-r--r--.  1 nginx nginx  1507 Jan 17 14:21 server_status_variables.php
-rw-r--r--.  1 nginx nginx  1625 Jan 17 14:21 server_user_groups.php
-rw-r--r--.  1 nginx nginx  1283 Jan 17 14:21 server_variables.php
drwxr-xr-x.  4 nginx nginx  4096 Jan 23 15:00 setup
-rw-r--r--.  1 nginx nginx  1039 Jan 17 14:21 show_config_errors.php
-rw-r--r--.  1 nginx nginx  5507 Jan 17 14:21 sql.php
-rw-r--r--.  1 nginx nginx  3474 Jan 17 14:21 tbl_addfield.php
-rw-r--r--.  1 nginx nginx  5763 Jan 17 14:21 tbl_change.php
-rw-r--r--.  1 nginx nginx  4400 Jan 17 14:21 tbl_chart.php
-rw-r--r--.  1 nginx nginx  2650 Jan 17 14:21 tbl_create.php
-rw-r--r--.  1 nginx nginx  2880 Jan 17 14:21 tbl_export.php
-rw-r--r--.  1 nginx nginx  1657 Jan 17 14:21 tbl_find_replace.php
-rw-r--r--.  1 nginx nginx  1334 Jan 17 14:21 tbl_get_field.php
-rw-r--r--.  1 nginx nginx  3452 Jan 17 14:21 tbl_gis_visualization.php
-rw-r--r--.  1 nginx nginx   590 Jan 17 14:21 tbl_import.php
-rw-r--r--.  1 nginx nginx  1205 Jan 17 14:21 tbl_indexes.php
-rw-r--r--.  1 nginx nginx  2828 Jan 17 14:21 tbl_move_copy.php
-rw-r--r--.  1 nginx nginx 12498 Jan 17 14:21 tbl_operations.php
-rw-r--r--.  1 nginx nginx  1474 Jan 17 14:21 tbl_printview.php
-rw-r--r--.  1 nginx nginx  4616 Jan 17 14:21 tbl_relation.php
-rw-r--r--.  1 nginx nginx 13504 Jan 17 14:21 tbl_replace.php
-rw-r--r--.  1 nginx nginx  3904 Jan 17 14:21 tbl_row_action.php
-rw-r--r--.  1 nginx nginx  2175 Jan 17 14:21 tbl_select.php
-rw-r--r--.  1 nginx nginx  1014 Jan 17 14:21 tbl_sql.php
-rw-r--r--.  1 nginx nginx  4577 Jan 17 14:21 tbl_structure.php
-rw-r--r--.  1 nginx nginx  3927 Jan 17 14:21 tbl_tracking.php
-rw-r--r--.  1 nginx nginx   144 Jan 17 14:21 tbl_triggers.php
-rw-r--r--.  1 nginx nginx  5996 Jan 17 14:21 tbl_zoom_select.php
drwxr-xr-x.  4 nginx nginx  4096 Jan 23 15:00 themes
-rw-r--r--.  1 nginx nginx   863 Jan 17 14:21 themes.php
-rw-r--r--.  1 nginx nginx  1348 Jan 17 14:21 transformation_overview.php
-rw-r--r--.  1 nginx nginx  3961 Jan 17 14:21 transformation_wrapper.php
-rw-r--r--.  1 nginx nginx   507 Jan 17 14:21 url.php
-rw-r--r--.  1 nginx nginx  6883 Jan 17 14:21 user_password.php
-rw-r--r--.  1 nginx nginx   550 Jan 17 14:21 version_check.php
-rw-r--r--.  1 nginx nginx  8914 Jan 17 14:21 view_create.php
-rw-r--r--.  1 nginx nginx  3613 Jan 17 14:21 view_operations.php
-rw-r--r--.  1 nginx nginx  1128 Jan 17 14:21 webapp.php

【问题讨论】:

  • 是的,你是对的,但那里没有解决方案。
  • 我有一个运行 php 5.5.8 的 centos 6.5 服务器,完全没有问题......虽然我不记得我是如何安装它的。抱歉,使用 phpMyAdmin
  • 我已经是最新版了。
  • 我不是 apache,我是 nginx,顺便说一下 config.inc.php 可以被 nginx 读取:-rwxr-xr-x. 1 nginx nginx 4236 Jan 15 14:09 config.inc.php

标签: php nginx phpmyadmin


【解决方案1】:

我找到了解决办法。

nginx/php-fpm 无法写入 /var/lib/php/session/ 文件夹,我刚刚编辑了 777 的权限,现在它可以工作了。

【讨论】:

  • 我刚刚将 777 放在我的会话文件夹中,但这并不能解决我的问题 :(
  • 这完全节省了我剩下的时间!
  • 即使在我完成所有这些操作后,它仍然向我显示相同的错误 - 我错过了 php-mbstring - 安装了它并且现在可以正常工作
  • A1 谢谢,我的 httpd 用户和组是非标准的。所以我将会话文件夹添加到我的 httpd 组中。
  • 更好用:chgrp -R nginx /var/lib/php/session
【解决方案2】:

不知道为什么,但我只能在将 chmod 755 设置为文件 config.inc.php 时才能解决此问题

【讨论】:

  • 在 CentOS 7 上,我用类似的解决方案解决了这个问题,并将 /etc/phpMyAdmin/config.inc.php 的组所有权从 root 更改为 apache
【解决方案3】:

确保 gettext 在php -m 中列出,如果没有安装它。

【讨论】:

    【解决方案4】:

    @Fez Vrasta

    你是如何安装和运行它的……我快死在这里了…… 我已经手动尝试过,而 nginx 从来没有看到这些文件......而且我几乎尝试了所有东西。 符号链接,直接在根文件夹中。

    如果我尝试从公共存储库安装,最后我会得到这样的结果:

    Error: Package: phpMyAdmin-4.1.6-1.el6.remi.noarch (remi)
           Requires: php-gmp
           Available: php-common-5.3.3-26.el6.i686 (base)
               php-gmp
           Available: php-common-5.3.3-27.el6_5.i686 (updates)
               php-gmp
           Available: php-common-5.4.23-1.el6.remi.i686 (remi)
               php-gmp
           Available: php-common-5.4.24-1.el6.remi.i686 (remi)
               php-gmp
           Installed: php-common-5.5.8-1.el6.remi.i686 (@remi-php55)
               Not found
    Error: Package: php-tidy-5.4.24-1.el6.remi.i686 (remi)
           Requires: php-common(x86-32) = 5.4.24-1.el6.remi
           Installed: php-common-5.5.8-1.el6.remi.i686 (@remi-php55)
               php-common(x86-32) = 5.5.8-1.el6.remi
           Available: php-common-5.3.3-26.el6.i686 (base)
               php-common(x86-32) = 5.3.3-26.el6
           Available: php-common-5.3.3-27.el6_5.i686 (updates)
               php-common(x86-32) = 5.3.3-27.el6_5
           Available: php-common-5.4.23-1.el6.remi.i686 (remi)
               php-common(x86-32) = 5.4.23-1.el6.remi
           Available: php-common-5.4.24-1.el6.remi.i686 (remi)
               php-common(x86-32) = 5.4.24-1.el6.remi
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest
    

    ====================================

    我的 LEMP 设置:

    • Centos 6.5
    • PHP 5.5.8
    • Nginx
    • MySQL 5.1.71

    ====================================

    【讨论】:

    • yum --enablerepo=remi,remi-test install phpMyAdmin 然后应用我的答案。
    • 我终于让事情运行起来了。这是发生在我身上的事情(它可能对某人有用)。操作系统在安装 PhPMyadmin 之前更新了一些库,部分更新涵盖了 PHP-FPM 包,较新版本的 PHP 与我安装的 PhPMyAdmin 版本仍有一些不一致。解决方法?:降级 PHP-FPM 版本并重新安装 PhpMyAdmin。希望对某人有所帮助。
    【解决方案5】:

    /var/lib/php/session/ 文件夹不能被 nginx/php-fpm 写入,我刚刚将权限编辑为 777,现在它可以工作了。

    这个解决方案有帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-25
      • 2016-09-17
      • 1970-01-01
      • 2014-12-15
      • 2014-11-15
      • 2016-10-15
      • 2014-01-11
      • 2016-01-29
      相关资源
      最近更新 更多