After installing magento 2.0.5 on a webserver (allinkl.com) i am recieving following error when i try to add come products in the backend: "Could not determine temp directory, please specify a cache_dir manually"

i already looked for solutions, but without any sucess.

what i did till now:

1) changed file.php ('cache_dir'=> '/var/tmp/') 2) var/cache/ and var/tmp/ both have chmod777 recursively

also i contacted the webhost regarding this failure (in my case i can not edit php.ini), they told me to try following:

1) create "temp" folder in magento root 2) edit .htaccess: add "php_value session.save_path /www/htdocs/xxxx/domain/temp/"

But this also did not work out.

Would be great if somebody could tell me how to solve this issue.

  • What OS are you on?
    – Maddy
    May 6, 2016 at 15:05
  • Linux dd25436 3.13.0-85-generic #129-Ubuntu SMP Thu Mar 17 20:50:15 UTC 2016 x86_64
    – Andrea92
    May 7, 2016 at 21:37

1 Answer 1


try this:

navigate to file: vendor/magento/zendframework1/library/Zend/Cache/Backend.php

edit the file (line 211) replace:

if ($this->_isGoodTmpDir('/tmp')) {
    return '/tmp';

by this:

if ($this->_isGoodTmpDir('var/tmp')) {
    return 'var/tmp';

only add var before /tmp do not add slash (/) before var.

tested on the 2.0.7 and working.

hope this will help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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