Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I downloaded PhpMyAdmin a while ago and am having a hard time getting it to work. Requesting localhost/phpmyadmin gives a 500 Internal Server Error response, but there's nothing in the error log.

These are the steps I did:

  1. Downloaded the newest phpmyadmin and unzipped all the files to /var/vhosts/phpmyadmin/www/
  2. Created a new php5-fpm pool and a server block on nginx
  3. Changed the owner of all the files inside phpmyadmin/
  4. Tried requesting localhost/phpmyadmin and localhost/phpmyadmin/setup

The phpmyadmin is running inside a chroot, and all the files are owned by www-data so it shouldn't be a permission error.

I made a new php file in the same directory to produce an error and it logs just fine so it has to be just phpmyadmin.

Here's my php5-fpm pool:

[phpmyadmin]
listen = /var/vhosts/phpmyadmin/tmp/.php.sock;
user = www-data
group = www-data

chroot = /var/vhosts/phpmyadmin/
chdir = /

php_admin_value[error_reporting] = E_ALL
php_admin_value[error_log] = error.log
php_admin_flag[log_errors] = on
php_admin_flag[display_errors] = on

php_value[session.save_handler] = files
php_value[session.save_path] = /tmp

And Nginx server block:

server {
        listen   80;
        root /var/vhosts/phpmyadmin/www;
        server_name pma.domain;

        location / {
                try_files $uri $uri/ /index.html;
                autoindex on;
        }

        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                include fastcgi_params;
                fastcgi_pass unix:/var/vhosts/phpmyadmin/tmp/.php.sock;
                fastcgi_param SCRIPT_FILENAME /www$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_script_name;
                fastcgi_param DOCUMENT_ROOT /www;
        }

    index index.html index.htm index.php;
    try_files $uri $uri/ =404;

}

Any ideas what could be wrong? Why is it not producing any errors even though I've forced them to be on?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

I found the error, now I just need to find out how to fix it. In common.inc.php there's a following line:

date_default_timezone_set(@date_default_timezone_get());

This function doesn't work due to chroot (can't read /usr/share/timezone, I believe) and doesn't produce an error because of the @ symbol. Commenting out the line gives a fatal error: "date(): Timezone database is corrupt - this should never happen! in /www/libraries/core.lib.php on line 623". Guess I'll have to copy the timezone directory to every vhost I have if I don't find a better solution.

Edit: Installed timezonedb using php-pear to be able to use timezones without copying them all inside chroots.

share|improve this answer

Have you set the listen.owner and listen.group directive to the right user/group, usually "www-data", for the pool?

listen.owner = www-data
listen.group = www-data
share|improve this answer
    
I did now, but it made no difference. PHP is listening fine as I made a new php file that printed hello world and another file which caused an error. The error was found in error.log as supposed to, but still for some reason the phpmyadmin won't log errors. My guess is that phpmyadmin has its own error handler, but I can't figure out how to get rid of it. –  ThrownAway May 29 at 7:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.