最近工作桌的那部電從Ubuntu 12.10升級到Ubuntu 13.04突然發現無法使用phpmyadmin。
Recently, I’ve upgraded my desktop in my working place from Ubuntu 12.10 to Ubuntu 13.04. After installation had finished, I found phpmyadmin couldnot operate properly.
從WebBroswer自到代碼500。於是我查看Apache 2 log:
There was 500 server error found in my webbrowser. So, I decided to check the Apache2 log:
cat /var/log/apache2/error.log
我看到:
From the log, I found the followings:
[Mon May 20 10:23:07 2013] [error] [client 127.0.0.1] PHP Stack trace: [Mon May 20 10:23:07 2013] [error] [client 127.0.0.1] PHP 1. {main}() /usr/share/phpmyadmin/index.php:0 [Mon May 20 10:23:07 2013] [error] [client 127.0.0.1] PHP 2. require_once() /usr/share/phpmyadmin/index.php:13 [Mon May 20 10:23:07 2013] [error] [client 127.0.0.1] PHP 3. require() /usr/share/phpmyadmin/libraries/common.inc.php:614 [Mon May 20 10:23:26 2013] [error] [client 127.0.0.1] PHP Fatal error: require_once(): Failed opening required './libraries/php-gettext/gettext.inc' (include_path='.') in /usr/share/phpmyadmin/libraries/select_lang.lib.php on line 370
看似是找不到gettext library。經網上查証,只要更改phpmyadmin所提供的apache.conf,在php_admin_value一行,末端加入:/usr/share/php/php-gettext/
即:
It seemed to be an error when the web page tried to look up the gettext library. I found a solution from the internet that requires me to add /usr/share/php/php-gettext/ to the line of php_admin_value in my apache.conf (the one that provided by phpmyadmin). The updated conf file should look like:
<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_admin_flag allow_url_fopen Off 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/ </IfModule> </Directory>
再重啟apache2:
After I had restarted my apache 2:
sudo /etc/init.d/apache2 restart
Wow.. phpmyadmin became normal again!