3

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.

asked Dec 14, 2015 at 14:53

3 Answers 3

2

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.

answered Dec 14, 2015 at 16:02
1

Not sure if this will solve the issue, but it is possible to specify custom directories for cache (and other directories declared in \Magento\Framework\App\Filesystem\DirectoryList::getDefaultConfig) during Magento installation using command line argument: --magento-init-params=MAGE_DIRS[cache][path]=/var/tmp/magento/var/cache&MAGE_DIRS[tmp][path]=/var/tmp/magento/var/tmp

Also, MAGE_DIRS should be initialized using SetEnv in web server config (e.g. in virtual host config), so that custom directories are used during each request processing.

answered Dec 14, 2015 at 15:18
1

If you got no rights to edit the php.ini, you can set up a PHP mod-version. Now use the following in your .htaccess

SetEnv TEMP /www/htdocs/your/path/mage/var/tmp
SetEnv TMP /www/htdocs/your/path/mage/var/tmp
SetEnv TMPDIR /www/htdocs/your/path/mage/var/tmp

You will need that for web hosters that support this.

7ochem
7,61516 gold badges54 silver badges82 bronze badges
answered May 30, 2016 at 11:16

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.