PhpMyAdmin 500 Internal Server Error on Nginx/php5-fpm/Debian

7,289

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:
7,289

Related videos on Youtube

ThrownAway
Author by

ThrownAway

Updated on September 18, 2022

Comments

  • ThrownAway
    ThrownAway over 1 year

    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?

  • ThrownAway
    ThrownAway almost 10 years
    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.