Skip to main content
Magento 2

Magento 2 – Could not determine temp directory

By May 10, 2016No Comments

The error ‘Could not determine temp directory, please specify a cache_dir manually‘ was a common issue in Magento 1 installs. The solution for Magento 2 is slightly easier but does require access to your php.ini file.

Magento 2 error

If Magento is unable to create zend_cache temp files, it’s likely that you’ll see the ‘Could not determine temp directory’ error in your admin area, preventing product and order tables from being shown.

Could not determine temp directory – Solution

Create a tmp folder

Create a tmp folder in the root of your Magento installation. Give this folder 775 permissions.

php.ini change

Now you need to tell Magento where to find this file. Open or create a php.ini file, in the root of your website.

;tmp directory
upload_tmp_dir = /FullPathToServerRoot/www/magento2/tmp/
sys_temp_dir = "/tmp"

Adding upload_tmp_dir = /FullPathToServerRoot/www/magento2/tmp/ should allow zend_cache temp files to be safely stored within your /tmp folder and allow you to view your admin pages without issue. You should be able to find the full path to your server in the file management area of your control panel.

If you don’t have access to a php.ini file or permission to create one, ask your hosting company if they can do this for you.

Let me know if this helped.

Andrew Taylor

A senior UI designer with over 25 years of web design and web development experience working for some of the largest companies in the UK. An expert in all things Magento and WordPress.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.