Magento – Could not determine temp directory, please specify a cache_dir manually

cachececonfigurationmagento2products

I have installed Magento 2.0.0.0 on Windows with IIS 8. When I try to add a new product I get a message:

"Could not determine temp directory, please specify a cache_dir manually"

Error message on Products page

When I click the 'Add Product' button anyway I don't get a data entry form that I would expect – it's mostly blank.

Blank new product screen

I have looked around at solutions, but they all seem to focus on versions earlier than 2.0.0.0 (e.g. this one applies to 1.8.1.0) and this is important because there is no app/code/core/Zend/Cache/Backend/ folder as described in that solution. There is however:

lib/internal/Cm/Cache/Backend and a File.php there. I have changed line 42 here to:

    'cache_dir' => 'var/tmp/', 

(Even though hacking away at the file in 'lib' doesn't feel right).

Still the message and problem persists.

Best Answer

This error is not Magento-specific. It relates to Zend Cache.

Set sys_temp_dir in php.ini to a path that can be reached by IUSR then restart IIS to apply changes.

Related Topic