Page 1 of 1

phpMyAdmin warning - open_basedir restriction in effect

Posted: Sun Mar 13, 2016 2:32 pm
by Vladimir Chanaev
Hi all!
Ubuntu 15.10 droplet on Digital Ocean. Fresh Vesta CP install (nginx + apache).
PhpMyAdmin displays such warnings. Databases seems to be fine and working.
How to fix this warnings, help plz.

===============================================================================================
Warning in ./libraries/Util.class.php#516
file_exists(): open_basedir restriction in effect. File(doc/html/index.html) is not within the allowed path(s): (/usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext)

Backtrace

./libraries/Util.class.php#516: file_exists(string 'doc/html/index.html')
./libraries/Util.class.php#540: PMA_Util::getDocuLink(
string 'index',
string '',
)
./libraries/plugins/auth/AuthenticationCookie.class.php#171: PMA_Util::showDocu(string 'index')
./libraries/common.inc.php#872: AuthenticationCookie->auth()
./index.php#12: require_once(./libraries/common.inc.php)
===============================================================================================

Screenshot: http://clip2net.com/clip/m88953/f9dca-clip-73kb.png

Re: phpMyAdmin warning - open_basedir restriction in effect

Posted: Fri Apr 15, 2016 5:18 am
by jacobmcilravey
Did you ever find a fix to this? I'm also having this issue with no luck.

Re: phpMyAdmin warning - open_basedir restriction in effect

Posted: Fri Apr 15, 2016 6:25 am
by BBuchanan1013
Unfortunately, this has specifically to do with Nginx. This doesn't affect Apache. The only way to solve this is to not use the built in phpmyadmin, but instead use a seperate manual install within the web directory of the domain.

For example, if your hosting:
blah.com
Then the web folder might be something like:
/home/admin/web/blah.com/public_html

That's where it would have to be installed under. Yes, you can install under a subdirectory. ie
phpmyadmin

But because the default is installed outside the specified web folders, it's a security block. Sorry.

Re: phpMyAdmin warning - open_basedir restriction in effect

Posted: Fri Apr 15, 2016 7:08 am
by jacobmcilravey
Hmm. I chose not to install Nginx? How would I go about doing what you've said then?

Re: phpMyAdmin warning - open_basedir restriction in effect

Posted: Fri Apr 15, 2016 12:42 pm
by Vladimir Chanaev
jacobmcilravey wrote:Did you ever find a fix to this? I'm also having this issue with no luck.
No, i didnt find how to fix it.
MySQL db work normaly.
Login to database also works normaly.

Inside PhpMyAdmin also much warnings. Something about configuration of PhpMyAdmin. Screen: http://clip2net.com/s/3wY3R1S
screen imageShow
Image
Operation with database under PhpMyAdmin - didnt test yet.

Just warring about security of this issue.

Re: phpMyAdmin warning - open_basedir restriction in effect

Posted: Fri Apr 22, 2016 1:31 pm
by skurudo
Vladimir Chanaev wrote: Inside PhpMyAdmin also much warnings. Something about configuration of PhpMyAdmin. Screen: http://clip2net.com/s/3wY3R1S
After install phpmyadmin incomplete. And we made fix for this:
viewtopic.php?f=14&t=10307

Re: phpMyAdmin warning - open_basedir restriction in effect

Posted: Tue May 24, 2016 3:31 pm
by jacobmcilravey
Didn't work on both servers I tried. The script doesn't work, and I'm still getting errors. Any other fix you can offer?

Re: phpMyAdmin warning - open_basedir restriction in effect

Posted: Tue May 24, 2016 8:20 pm
by skurudo
jacobmcilravey wrote:Didn't work on both servers I tried. The script doesn't work, and I'm still getting errors. Any other fix you can offer?
PM me server details (root login/pass), let's see what's going on.

Re: phpMyAdmin warning - open_basedir restriction in effect

Posted: Thu May 26, 2016 10:02 am
by twister5800
have done fresh install on ubuntu 15 lts and did everything as root (not sudo), got the error, I did then run the script, all showed OK in the script log, rebooted server, and phpmyadmin still shows:

Code: Select all

 file_exists(): open_basedir restriction in effect. File(doc/html/index.html)
UPDATE:

Fixed with this:

Code: Select all

nano /etc/apache2/conf.d/phpmyadmin.conf
Find this line:

Code: Select all

php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext
Add /usr/share/doc to it, so it looks like this:

Code: Select all

php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext:/usr/share/doc
Save and do "service apache2 restart"

Solved :-)

Re: phpMyAdmin warning - open_basedir restriction in effect

Posted: Thu Jun 09, 2016 6:59 am
by skurudo
Nice one, twister5800!