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

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

    1) create the tmp folder

    mkdir /usr/share/phpmyadmin/tmp
    

    2) findout your php user

    <?php echo `whoami`; ?>
    

    3) Change ownership of the tmp folder to the php user found in step 2

    sudo chown -R step2phpuser:step2phpuser /usr/share/phpmyadmin/tmp
    

    4) Signout of phpmyadmin and sign back in

    0 讨论(0)
  • 2021-01-30 13:04

    I had the same error message. I'm using Ubuntu16.04 with lampp. You should go to 'phpmyadmin' directory, in my case '/opt/lampp/phpmyadmin/', create a new 'tmp' folder. Open a terminal window and:

    cd YOUR_PATH_TO_PHPMYADMIN
    sudo mkdir tmp
    

    Now you have to change the group of the 'tmp' folder to give access to php user. In order to find it, you can create a php file inside your localhost directory, in my case 'htdocs'

    sudo touch user.php
    sudo nano user.php
    

    Inside nano editor, type:

    <?php echo `whoami`; ?>
    

    Then press CTRL + O and CTRL + X to save and exit. Open the browser and type in your address bar

    localhost/user.php
    

    It shows your php user.

    After that, go to the terminal and navigate to your recently created 'tmp' directory inside phpmyadmin directory and type:

    sudo chgrp YOUR_PHP_USER tmp -R
    

    And change the permission to the 'tmp' directory:

    sudo chmod 775 tmp -R
    

    I recommend never give 777 permission to any file.

    I hope it helps!

    0 讨论(0)
  • 2021-01-30 13:05

    Solution was to create a folder called tmp like this: /usr/share/phpmyadmin/tmp.

    Also make sure that the user (or group) running the webserver (e.g. Apache) has write access to the newly created tmp folder. Consequently, change the ownership to that user or add write access for all users. The latter one might not be really advisable.

    0 讨论(0)
  • 2021-01-30 13:06

    I had the same problem but none of the answers above could solve. In my case my php security settings was so strict protecting php to access directories out of scope defined in open_basedir located at my /etc/php.d/99-security.ini(which I added perviously from a security toturial and the settings also could be located at /etc/php.ini file in your case):

    ;; Limit PHP Access To File System
    ; Limits the PHP process from accessing files outside
    ; of specifically designated directories such as /var/www/html/
    open_basedir="/home/:/etc/phpMyAdmin/:/var/lib/phpMyAdmin/"
    

    change to:

    open_basedir="/home/:/etc/phpMyAdmin/:/var/lib/phpMyAdmin/:'/usr/share/phpmyadmin/tmp/"  ;<== changing to this solved the prblem
    

    you just need to add your own directory in error mesage ('/usr/share/phpmyadmin/tmp/') and the end of open_basedir option. Don't forget placing separator : before adding it.

    0 讨论(0)
  • 2021-01-30 13:10

    In my case I added

    $cfg['TempDir'] = '/usr/share/phpmyadmin/temp';
    

    to the

    config.inc.php File within the phpmyadmin folder

    Hope it will help someone

    0 讨论(0)
  • 2021-01-30 13:13

    For Arch and Manjaro users:

    Create a folder tmp at /etc/webapps/phpmyadmin/ - mkdir /etc/webapps/phpmyadmin/tmp

    Set permission to 777 - chmod 777 /etc/webapps/phpmyadmin/tmp

    Add this line to the config file at /etc/webapps/phpmyadmin/config.inc.php - $cfg['TempDir'] = '/tmp';

    Cheers :)

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