【发布时间】:2017-06-17 14:54:30
【问题描述】:
我今天更新了我的服务器,实际上当我访问 mywebsite.com/phpmyadmin/ => 我收到了 error 500
错误日志:
PHP Warning: require_once(): open_basedir restriction in effect. File(/usr/share/php/php-php-gettext/gettext.inc) is not within the allowed path(s): (/usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/) in /usr/share/phpmyadmin/libraries/common.inc.php on line 77
PHP Warning: require_once(/usr/share/php/php-php-gettext/gettext.inc): failed to open stream: Operation not permitted in /usr/share/phpmyadmin/libraries/common.inc.php on line 77
PHP Fatal error: require_once(): Failed opening required '/usr/share/php/php-php-gettext/gettext.inc' (include_path='.') in /usr/share/phpmyadmin/libraries/common.inc.php on line 77
我的 apache.conf:
我的 php.ini:
我的 /usr/share/php:
drwxr-xr-x 2 root root 4096 févr. 1 00:29 php-gettext
drwxr-xr-x 2 root root 4096 févr. 1 00:16 php-php-gettext
在 /usr/share/php/php-gettext:
lrwxrwxrwx 1 root root 30 janv. 29 16:13 gettext.inc -> ../php-php-gettext/gettext.inc
lrwxrwxrwx 1 root root 30 janv. 29 16:13 gettext.php -> ../php-php-gettext/gettext.php
lrwxrwxrwx 1 root root 30 janv. 29 16:13 streams.php -> ../php-php-gettext/streams.php
在 /usr/share/php/php-php-gettext:
lrwxrwxrwx 1 root root 30 janv. 29 16:13 gettext.inc -> ../php-php-gettext/gettext.inc
lrwxrwxrwx 1 root root 30 janv. 29 16:13 gettext.php -> ../php-php-gettext/gettext.php
lrwxrwxrwx 1 root root 11 févr. 1 00:16 php-gettext -> php-gettext
lrwxrwxrwx 1 root root 30 janv. 29 16:13 streams.php -> ../php-php-gettext/streams.php
我的 PHP-GetText 版本:
php-mbstring is already the newest version (1:7.0+49).
php-gettext is already the newest version (1.0.12-0.1).
php7.0-mbstring is already the newest version (7.0.15-1).
我测试了很多东西,但对我的服务器没有任何效果:\有人可以帮助我吗?
此致,
【问题讨论】:
-
检查您的 php ini 设置并更改
include_path以允许从您的 Web 根目录中包含/usr/share/phpmyadmin/路径。显然事后重启httpd守护进程,想必是Ubuntu用sudo service restart httpd -
我尝试添加:php_value include_path .:/usr/share/phpmyadmin/ 并重新启动我的 apache2 但不起作用:\
-
看起来您正在使用由您的发行版的包管理器维护的 phpMyAdmin 版本。尝试重新配置 phpmyadmin 软件包,甚至删除并重新安装它(只要您只删除 phpMyAdmin,您就不会丢失任何东西,但当然适用于通常的备份免责声明)。你说你更新了服务器,从哪个版本升级到哪个版本,还有哪些软件包升级了,PHP和phpMyAdmin是什么版本?
标签: php mysql phpmyadmin open-basedir php-gettext