PHP open_basedir and phpMyAdmin

Discussion in 'General' started by midcarolina, Nov 13, 2011.

  1. midcarolina

    midcarolina New Member


    I haven't been able to access phpMyAdmin through ISPConfig 3 or by URL since updating to 3.0.4. Each time I got a new error, I would resolve, then finally got to one that I couldn't seem to get. I Googled this a lot, and didn't (and still don't want to) disable PHP open_basedir in ISPConfig by clearing the entire file paths in the PHP open_basedir field and replacing with "none", then save. It works.

    My understanding is that this is a big security risk. While I certainly don't want that, I have to be able to access the dbs.

    Any help would be great.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Just add the path to phpmyadmin to the openbasedir path separated by : in all existing websites.

    You can also set the default for new websites under system > server config > web
  3. midcarolina

    midcarolina New Member

    Hi Till,

    Remember we already tried this. All the paths were there, which is where I get the error, like this in each site:

    open_basedir restriction in effect. File(/usr/share/phpMyAdmin/libraries/ is not within the allowed path(s): (/var/www/clients/client1/web1/web:/var/www/clients/client1/web1/tmp:/var/www/ in /usr/share/phpMyAdmin/index.php on line 33

    Was always like this with no problems with ISPC

    Only way to access phpMyAdmin was to empty the PHP openbasedir in ISPConfig and insert "none", then save. Now I can access phpMyAdmin just fine, only concerned about security now.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    As you see in the above error message (which lists the paths that you entered in the open basedir field) you had not added the new path to phpmyadmin there. And remeber that we are on a unix based os here, so upper / lower case in paths makes a difference. Adding the path works for everyone else and it works on my server as well, so it will work on your server too.
  5. midcarolina

    midcarolina New Member

    I guess I just don't get the big picture or something. All of the paths to phpMyAdmin are in that list. So I don't what other path to phpMyAdmin to add. I hope that makes sense. Those paths in the error message were also EXACT matches to the paths listed in ISPConfig - the ones that I had to clear out to get access to phpMyAdmin. So what is the new path? What path am I missing?

  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The path where phpmyadmin is installed is not in the list. PHPMyadmin is installed in the path /usr/share/phpMyAdmin and this path is not in the open basedir string.
  7. midcarolina

    midcarolina New Member

    Here is the PHP open basedir string on all three servers in System >> Server Config >> Web and also what is then converted into all websites as well:


    Note that /usr/share/phpMyAdmin is right behind /usr/share/php5: (This is a direct copy / paste from ISPConfig 3.0.4

    Removing this string in each website and placing none in the field is the only way I can access phpMyAdmin through ISP or URL
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Read my post above in which TWO places you should add the string (System Server Config AND in all existing websites)! You prooved already with the above error message in #3 that you havent set it in the website as I told you. If you dont follow instructions closely, it will never work.

Share This Page