letstalk
By:
letstalk

Phpmyadmin HTTP Error 500 After complete installation and security login prompts but nothing

January 20, 2017 623 views
PHP Ubuntu 16.04

I installed the phpmyadmin looking at the digital ocean guide. After completing each step sucessfully the phpmyadmin does show the pop-up at example.com/phpmyadmin after to it there is no reponse when I login it shows HTTP Error 500. I checked the Apache2 log it didn't showed any error.
So I did reconfiguration of the phpmyadmin still the issue persist out to be same. I also tried installing few php addons as looking at the forum those were php-mbstring php7.0-mbstring php-gettext also they got install and configure still the Phpmyadmin showcased HTTP Error 500 after login. Is the issue related to .htacess ?
The phpmyadmin .htacess has following code
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/apache2/.phpmyadmin.htpasswd
Require valid-user

Just help me out what;s the exact issue which is persisted ?

2 Answers

@letstalk

Which guide did you follow? If you would, please provide the link.

If you delete your .htaccess file and attempt to access the URI to your phpMyAdmin installation, does it work or do you still get the same error -- or do you see a different error?

If, after deleting your .htaccess file, you're able to access the installation, then we know that the issue is most likely with that file and you'll want to double-check that there are no extra spaces or tabs -- before or after (this can happen if you copy and paste sometimes).

  • I used this guide https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-16-04

    Also I tried deleting the htaccess file then the chrome said the error the example.com page isn't working. I removed the line from the apache conf file for phpmyadmin alloworride one still the issue was page isn't working. Earlier before installation I use to get error 404 from the site.

    While many users require access to a database management system like MySQL, not all users feel comfortable interacting with the MySQL prompt on a daily basis. In this guide, we'll discuss how to install and secure phpMyAdmin, a web management interface for MySQL, on an Ubuntu 16.04 server.
  • Here's the Error log which I found

    [Fri Jan 20 20:19:04.136116 2017] [:error] [pid 27998] [client 111.91.113.204:51123] PHP Warning: requireonce(): openbasedir restriction $
    [Fri Jan 20 20:19:04.136371 2017] [:error] [pid 27998] [client 111.91.113.204:51123] PHP Warning: requireonce(/usr/share/php/php-php-gette$
    [Fri Jan 20 20:19:04.136390 2017] [:error] [pid 27998] [client 111.91.113.204:51123] PHP Fatal error: require
    once(): Failed opening requir$
    [Fri Jan 20 20:19:04.767725 2017] [:error] [pid 27996] [client 111.91.113.204:51125] PHP Warning: requireonce(): openbasedir restriction $
    [Fri Jan 20 20:19:04.767841 2017] [:error] [pid 27996] [client 111.91.113.204:51125] PHP Warning: requireonce(/usr/share/php/php-php-gette$
    [Fri Jan 20 20:19:04.767850 2017] [:error] [pid 27996] [client 111.91.113.204:51125] PHP Fatal error: require
    once(): Failed opening requir$
    [Fri Jan 20 20:19:05.285656 2017] [:error] [pid 27995] [client 111.91.113.204:51127] PHP Warning: requireonce(): openbasedir restriction $
    [Fri Jan 20 20:19:05.285759 2017] [:error] [pid 27995] [client 111.91.113.204:51127] PHP Warning: requireonce(/usr/share/php/php-php-gette$
    $required '/usr/share/php/php-gettext/gettext.inc' (include
    path='.') in /usr/share/phpmyadmin/libraries/common.inc.php on line 77

@letstalk

If you would, please post the contents of your configuration and I'll be more than happy to take a look at it for you. Essentially, copy and paste what's between the opening and closing VirtualHost blocks and wrap it with three starting backticks and three closing backticks (that'll create a code block and keep it organized inside the comments section).

  • @jtittle
    Here's the phpmyadmin apache config file has, I couldn't find virtual host or something like that

    # phpMyAdmin default Apache configuration
    
    Alias /phpmyadmin /usr/share/phpmyadmin
    
    <Directory /usr/share/phpmyadmin>
        Options SymLinksIfOwnerMatch
        DirectoryIndex index.php
        AllowOverride All
        <IfModule mod_php5.c>
            <IfModule mod_mime.c>
                AddType application/x-httpd-php .php
            </IfModule>
            <FilesMatch ".+\.php$">
                SetHandler application/x-httpd-php
            </FilesMatch>
    
            php_flag magic_quotes_gpc Off
            php_flag track_vars On
            php_flag register_globals Off
            php_admin_flag allow_url_fopen On
            php_value include_path .
            php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
            php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/v$
        </IfModule>
        <IfModule mod_php.c>
            <IfModule mod_mime.c>
                AddType application/x-httpd-php .php
            </IfModule>
            <FilesMatch ".+\.php$">
            SetHandler application/x-httpd-php
            </FilesMatch>
    
            php_flag magic_quotes_gpc Off
            php_flag track_vars On
            php_flag register_globals Off
            php_admin_flag allow_url_fopen On
            php_value include_path .
            php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
            php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/
         </IfModule>
    
    </Directory>
    
    # Authorize for setup
    <Directory /usr/share/phpmyadmin/setup>
        <IfModule mod_authz_core.c>
            <IfModule mod_authn_file.c>
                AuthType Basic
                AuthName "phpMyAdmin Setup"
                 AuthUserFile /etc/phpmyadmin/htpasswd.setup
            </IfModule>
            Require valid-user
        </IfModule>
    </Directory>
    
    # Disallow web access to directories that don't need it
    <Directory /usr/share/phpmyadmin/libraries>
        Require all denied
    </Directory>
    <Directory /usr/share/phpmyadmin/setup/lib>
        Require all denied
    </Directory>
    
    
    • @letstalk

      Was this, by chance, copied from the terminal output? If so, you'd be better off logging in to SFTP, downloading the file, and then doing a copy & paste as doing so from terminal leads to missing details and random $ signs being inserted.

      The error you're receiving from your previous output is due to the line starting with:

      php_admin_value open_basedir
      

      I've intentionally not copied the entire line as that's one of the lines with a trailing $, but to test if that's the only issue, I would comment that line out and then restart apache.

  • Attaching the recent apache error log

    
    [Sat Jan 21 19:17:53.666559 2017] [:error] [pid 3044] [client 111.91.113.46:64023] 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-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
    [Sat Jan 21 19:17:53.666662 2017] [:error] [pid 3044] [client 111.91.113.46:64023] 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
    [Sat Jan 21 19:17:53.666671 2017] [:error] [pid 3044] [client 111.91.113.46:64023] PHP Fatal error:  require_once(): Failed opening required '/usr/share/php/php-gettext/gettext.inc' (include_path='.') in /usr/share/phpmyadmin/libraries/common.inc.php on line 77
    [Sat Jan 21 19:17:55.440000 2017] [:error] [pid 3045] [client 111.91.113.46:64026] 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-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
    [Sat Jan 21 19:17:55.440131 2017] [:error] [pid 3045] [client 111.91.113.46:64026] 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
    [Sat Jan 21 19:17:55.440152 2017] [:error] [pid 3045] [client 111.91.113.46:64026] PHP Fatal error:  require_once(): Failed opening required '/usr/share/php/php-gettext/gettext.inc' (include_path='.') in /usr/share/phpmyadmin/libraries/common.inc.php on line 77
    [Sat Jan 21 19:17:58.056655 2017] [:error] [pid 3046] [client 111.91.113.46:64027] 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-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
    [Sat Jan 21 19:17:58.056775 2017] [:error] [pid 3046] [client 111.91.113.46:64027] 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
    [Sat Jan 21 19:17:58.056784 2017] [:error] [pid 3046] [client 111.91.113.46:64027] PHP Fatal error:  require_once(): Failed opening required '/usr/share/php/php-gettext/gettext.inc' (include_path='.') in /usr/share/phpmyadmin/libraries/common.inc.php on line 77
    
Have another answer? Share your knowledge.