2

I updated my server today and actually when i'm going to mywebsite.com/phpmyadmin/ => I got an error 500

Error.log:

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

My apache.conf:

http://pastebin.com/YZRXGmas

My php.ini:

http://pastebin.com/Mt8uE0P9

My /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

In /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

In /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

My PHP-GetText's version:

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).

I tested a lot of things but nothing work for my server :\ Someone can help me please?

Sincerely,

pomme
  • 23
  • 1
  • 4
  • 1
    Check your php ini settings and change the `include_path` to allow the `/usr/share/phpmyadmin/` path to be included from your web root directory. Obviously restart the httpd deamon afterwards, presumably Ubuntu with `sudo service restart httpd` – Xorifelse Feb 01 '17 at 00:36
  • I tried to add:php_value include_path .:/usr/share/phpmyadmin/ and restart my apache2 but doesn't work :\ – pomme Feb 01 '17 at 00:55
  • It looks like you're using a version of phpMyAdmin maintained by your distribution's package manager. Try to reconfigure the phpmyadmin package or even remove and reinstall it (as long as you only remove phpMyAdmin you shouldn't lose anything, but of course the usual disclaimers about backups apply). You said you updated the server, from which version to which and also which packages got upgraded and what versions are PHP and phpMyAdmin? – Isaac Bennetch Feb 01 '17 at 16:31

1 Answers1

2

Add /usr/share/php/php-php-gettext to then open_basedir setting in /etc/apache2/conf-enabled/phpmyadmin.conf

alx
  • 21
  • 2
  • 2
    Please add an explanation on how this solves OP's issue. – Andrzej Ziółek Oct 12 '18 at 07:36
  • @AndrzejZiółek By default, `/usr/share/php/php-gettext` is defined in conf file as a path in `open_basedir`. But it contains symlinks. Didn't dig, but I guess 'FollowSymLinks' directive is set to 'do not follow' by default in more recent apache2 configs. Giving the realpath (`/usr/share/php/php-php-gettext`) makes it work. Worked for me anyway, thanks @alx. – tisc0 Sep 22 '21 at 22:40