Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internal server error (HTTP Error 500) after installing phpmyadmin on a certain domain

I'm getting internal server error (HTTP Error 500) after installing phpmyadmin on a certain domain.

This is what my config.inc.php file currently reads.

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * phpMyAdmin sample configuration, you can use it as base for
 * manual configuration. For easier setup you can use setup/
 *
 * All directives are explained in documentation in the doc/ folder
 * or at <http://docs.phpmyadmin.net/>.
 *
 * @package PhpMyAdmin
 */

/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = 'a8b7c6d'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
/*
 * Servers configuration
 */
$i = 0;

/*
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

/*
 * phpMyAdmin configuration storage settings.
 */

/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';

/* Storage database and tables */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma__relation';
// $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
// $cfg['Servers'][$i]['history'] = 'pma__history';
// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
// $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
// $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma__recent';
// $cfg['Servers'][$i]['users'] = 'pma__users';
// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

/*
 * End of servers configuration
 */

/*
 * Directories for saving/loading files from server
 */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

/**
 * Defines whether a user should be displayed a "show all (records)"
 * button in browse mode or not.
 * default = false
 */
//$cfg['ShowAll'] = true;

/**
 * Number of rows displayed when browsing a result set. If the result
 * set contains more rows, "Previous" and "Next".
 * default = 30
 */
//$cfg['MaxRows'] = 50;

/**
 * disallow editing of binary fields
 * valid values are:
 *   false    allow editing
 *   'blob'   allow editing except for BLOB fields
 *   'noblob' disallow editing except for BLOB fields
 *   'all'    disallow editing
 * default = blob
 */
//$cfg['ProtectBinary'] = 'false';

/**
 * Default language to use, if not browser-defined or user-defined
 * (you find all languages in the locale folder)
 * uncomment the desired line:
 * default = 'en'
 */
//$cfg['DefaultLang'] = 'en';
//$cfg['DefaultLang'] = 'de';

/**
 * default display direction (horizontal|vertical|horizontalflipped)
 */
//$cfg['DefaultDisplay'] = 'vertical';


/**
 * How many columns should be used for table display of a database?
 * (a value larger than 1 results in some information being hidden)
 * default = 1
 */
//$cfg['PropertiesNumColumns'] = 2;

/**
 * Set to true if you want DB-based query history.If false, this utilizes
 * JS-routines to display query history (lost by window close)
 *
 * This requires configuration storage enabled, see above.
 * default = false
 */
//$cfg['QueryHistoryDB'] = true;

/**
 * When using DB-based query history, how many entries should be kept?
 *
 * default = 25
 */
//$cfg['QueryHistoryMax'] = 100;

/**
 * Should error reporting be enabled for JavaScript errors
 *
 * default = 'ask' 
 */
//$cfg['SendErrorReports'] = 'ask';

/*
 * You can find more configuration options in the documentation
 * in the doc/ folder or at <http://docs.phpmyadmin.net/>.
 */
?>

What changes do I need to do on this file? I've already followed up various posts but its not helping. It this the problem with the domain being down?

Thanks in advance.

like image 391
Phantom Avatar asked Feb 11 '14 10:02

Phantom


3 Answers

If you are using apache2.4 and PHP 7, run

sudo apt-get install php-mbstring php7.0-mbstring php-gettext

then restart your server

sudo service apache2 restart
like image 54
Fredrick Anyera M Avatar answered Oct 23 '22 07:10

Fredrick Anyera M


I know it has been a couple of years, and I noticed by your comments that still no luck. Here I run into the same 500 error after installing through apt. I look for my Apache error log file (/var/log/apache2/error.log), and there was the following entry:

[Thu Aug 11 22:38:25.930453 2016] [:error] [pid 18138] [client ::1:35026] PHP Fatal error:  require_once(): Failed opening required '/usr/share/php/php-gettext/gettext.inc' (include_path='.:/usr/share/php') in /usr/share/phpmyadmin/libraries/select_lang.lib.php on line 477

It shows that the library gettext was not found, so I intalled it:

sudo apt-get install  php-gettext

And restarted Apache:

sudo service apache2 restart

That worked for me. Hope it helps. PS: If still not working you may try to sym link the folder just in case:

sudo ln -s /usr/share/phpmyadmin /var/www/
like image 27
Raúl Avatar answered Oct 23 '22 07:10

Raúl


OK, if you have already installed packages php-mbstring and php-gettext and it still doesn't work, first take a look to Apache logs:

tail /var/log/apache2/error.log

If you find something like this:

Fatal error: Uncaught Twig_Error_Syntax: Unexpected "apply" tag (expecting closing tag for the "if" tag defined near line 17). in /usr/share/phpmyadmin/templates/columns_definitions/column_virtuality.twig on line 17

This is a known bug in phpmyadmin 4.9.4

The bug has been fixed in phpmyadmin 4.9.5 but please note that if you are under Debian 10 Buster you will need to upgrade the package php-twig to an higher version rather than the one included with Buster, or package phpmyadmin will be kept back to 4.9.4 during system upgrades.

You can simply upgrade php-twig from next Debian version (11, Bullseye)

apt-get install php-twig/bullseye

This worked for me. Hope this doesn't broke something else in Deb 10 LAMP setup.

like image 3
bytepan Avatar answered Oct 23 '22 05:10

bytepan