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

前端 未结 20 2355
别跟我提以往
别跟我提以往 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:53

    well,in my case this error has occured when i was using ubuntu 18.04. All you need is to go to the installation directory (in ubuntu - opt/lampp/phpmyadmin) and create a folder tmp with all the suitable read/write permissions.

    Follow these steps in case of ubuntu-

    1.go to the PMA installation directory by typing following commands in cmd-

    cd opt/lampp/phpmyadmin

    2.Then type the following command-

    sudo mkdir tmp && chmod 777 tmp

    and then you are done..!! I hope it helps..

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2021-01-30 12:55

    Create a tmp folder in the base directory of the phpMyAdmin install (e.g. /usr/share/phpmyadmin/tmp), and make sure that it is writable by the user that PHP is running under.

    0 讨论(0)
  • 2021-01-30 12:56

    If the folder already exists for example from a previous installation:

    chmod -R 777 PATH_TO_FOLDER
    

    Therefore permission on subdirectories are also modified (recursively).

    0 讨论(0)
  • 2021-01-30 12:59

    For me phpmyadmin dir was found inside /opt/lampp/

    1. open teminal inside /opt/lampp/phpmyadmin/
    2. give root privileges to the terminal by typing sudo su command.
    3. now in same terminal use (mkdir -p /tmp/) hit enter
    4. now, chmod 777 /tmp
    5. Inside phpmyadmin directory there is a file config.inc.php. Open it using same terminal .
    6. add this line $cfg['TempDir'] = /tmp; and Save.
    7. Now you are good to go , just reload the tab and the error will be gone.
    0 讨论(0)
  • 2021-01-30 12:59

    I just changed my vendor_config.php file to define('TEMP_DIR', '/tmp/'); instead of define('TEMP_DIR', './tmp/');

    This seems to work.

    0 讨论(0)
提交回复
热议问题