phpmyadmin blank & open_basedir restriction in effect

Discussion in 'Installation/Configuration' started by 5t3f4n, Apr 7, 2013.

  1. 5t3f4n

    5t3f4n New Member

    hi,

    can't access phpmyadmin anymore - openening the URL https://123.4.567.891:50443/phpmyadmin/ returns blank page. open_basedir entries in ISPConfig haven't been changed either.

    apache error log outputs:

    PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/share/phpmyadmin/index.php) is not within the allowed path(s): (/usr/share/php:/usr/l$
    PHP Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0
    PHP Fatal error: Unknown: Failed opening required '/usr/share/phpmyadmin/index.php' (include_path='.') in Unknown on line 0

    was reading lot of forum posts here but nothing has helped to resolve.

    anyone any ideas?

    thx
     
  2. 8omas

    8omas New Member HowtoForge Supporter

    The problem is the same as with round cube. Search the forum.

    try pasting something like this at the end of /etc/phpmyadmin/apache.conf

    Code:
    <IfModule mod_php5.c>
    AddType application/x-httpd-php .php
    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_admin_flag allow_url_fopen Off
    php_value include_path .:/usr/share/php:/usr/share/pear
    php_admin_value upload_tmp_dir /tmp
    php_admin_value open_basedir /usr/share/php:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp
    php_flag register_globals off
    </IfModule>
     
  3. 5t3f4n

    5t3f4n New Member

  4. 8omas

    8omas New Member HowtoForge Supporter

    please post the phpmyadmin.conf file
    p.s.
    Keeep in mind that the tutorial you read is old and is not recommened for ISPConfig v 3.0.5.and above. You have to be vary careful with backup, firewall and redirections.
     
  5. 5t3f4n

    5t3f4n New Member

    good morning,
    this is from /etc/apache2/conf.d/phpmyadmin.conf

    Code:
    # phpMyAdmin default Apache configuration
    
    Alias /dbmyadmin /usr/share/phpmyadmin
    
    <Directory /usr/share/phpmyadmin>
            Options FollowSymLinks
            DirectoryIndex index.php
    
            <IfModule mod_php5.c>
                    AddType application/x-httpd-php .php
    
                    php_flag magic_quotes_gpc Off
                    php_flag track_vars On
                    php_flag register_globals Off
                    php_value include_path .
            </IfModule>
    
    </Directory>
    
    # Authorize for setup
    <Directory /usr/share/phpmyadmin/setup>
        <IfModule mod_authn_file.c>
        AuthType Basic
        AuthName "phpMyAdmin Setup"
        AuthUserFile /etc/phpmyadmin/htpasswd.setup
        </IfModule>
        Require valid-user
    </Directory>
    
    # Disallow web access to directories that don't need it
    <Directory /usr/share/phpmyadmin/libraries>
        Order Deny,Allow
        Deny from All
    </Directory>
    <Directory /usr/share/phpmyadmin/setup/lib>
        Order Deny,Allow
        Deny from All
    </Directory>
    
    <IfModule mod_rewrite.c>
      <IfModule mod_ssl.c>
        <Location /dbmyadmin>
          RewriteEngine on
          RewriteCond %{HTTPS} !^on$ [NC]
          RewriteRule . https://%{HTTP_HOST}:50443%{REQUEST_URI}  [L]
        </Location>
      </IfModule>
    </IfModule>
    
    <IfModule mod_php5.c>
            AddType application/x-httpd-php .php
            php_flag magic_quotes_gpc Off
            php_flag track_vars On
            php_admin_flag allow_url_fopen Off
            php_value include_path .:/usr/share/php:/usr/share/pear
            php_admin_value upload_tmp_dir /tmp
            php_admin_value open_basedir /usr/share/php:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp
            php_flag register_globals off
    </IfModule>
     
  6. 8omas

    8omas New Member HowtoForge Supporter

    Try replacing <IfModue mod_php5.c> (IN the <Directory /usr/share/phpmyadmin> </Directory>) with this

    Code:
            <IfModule mod_php5.c>
                    AddType application/x-httpd-php .php
    
                    php_flag magic_quotes_gpc Off
                    php_flag track_vars On
                    php_flag register_globals Off
                    php_value include_path .
                    php_admin_flag allow_url_fopen Off
                    php_admin_value upload_tmp_dir /tmp
                    php_value include_path .:/usr/share/php:/usr/share/pear
                    php_admin_value open_basedir /usr/share/php:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp
            </IfModule>

    so as the result will be sth like this
    Code:
     <Directory /usr/share/phpmyadmin>
            Options FollowSymLinks
            DirectoryIndex index.php
    
            <IfModule mod_php5.c>
                    AddType application/x-httpd-php .php
    
                    php_flag magic_quotes_gpc Off
                    php_flag track_vars On
                    php_flag register_globals Off
                    php_value include_path .
                    php_admin_flag allow_url_fopen Off
                    php_admin_value upload_tmp_dir /tmp
                    php_value include_path .:/usr/share/php:/usr/share/pear
                    php_admin_value open_basedir /usr/share/php:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp
            </IfModule>
    
    </Directory>
    Then restart - reload apache
     
  7. 5t3f4n

    5t3f4n New Member

    thx 8omas, spot on - running again!
     
  8. ginner159

    ginner159 New Member HowtoForge Supporter

    Thanks alot!

    Thanks i was having this problem too after a php script for the api ran funny. no idea how it broke lol
     

Share This Page