Error in phpMyAdmin after updating to v4.8.0: The $cfg['TempDir'] (./tmp/) is not accessible

前端 未结 20 2399
别跟我提以往
别跟我提以往 2021-01-30 12:50

phpMyAdmin worked fine with v4.7.9. Now after updating to v4.8.0 today (replacing the old phpmyadmin folder against the new one) I\'m getting this mess

20条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-30 12:55

    Create a temp directory owned by and restricted to the webserver user. Do not place it inside of the phpMyAdmin webroot. (In this example, the webserver runs as apache):

    mkdir -p /var/tmp/phpMyAdmin
    chown apache:apache /var/tmp/phpMyAdmin
    chmod 700 /var/tmp/phpMyAdmin
    

    Next, set TempDir inside of phpMyAdmin's config.inc.php:

    $cfg['TempDir'] = '/var/tmp/phpMyAdmin';
    

    Any answer suggesting that you create /usr/share/phpmyadmin/tmp is advocating bad security practice. This is generally true for temp directories, and explicitly stated in the official phpMyAdmin documentation:

    For security reasons, all directories should be outside the tree published by webserver.

提交回复
热议问题