cancel
Showing results for 
Search instead for 
Did you mean: 

Could not determine temp directory, please specify a cache_dir manually

Could not determine temp directory, please specify a cache_dir manually

 

After installing CE magento 2.0.5 (websetup) on a webserver (allinkl.com) i am recieving following error when i try to add some 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.

Actually i got stuck because of this failure, as i can not add any product or do anything with the shop right now, Would be great if somebody could tell me how to solve this issue.

9 REPLIES

Re: Could not determine temp directory, please specify a cache_dir manually

Hello,

 

Create file with content:

 

<?php 

phpinfo();

 

 

Upload it to your host as phpinfo.php

 

 

Provide URL here so I can open it with my browser.

 

Or provide all PHP configuration content here.

 

 

 

Stanislav

Re: Could not determine temp directory, please specify a cache_dir manually

Hello Stanislav!

 

Here is the link: http://autoteileplus.at/phpinfo.php

Re: Could not determine temp directory, please specify a cache_dir manually

Hello:

 

> 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/"

 

 

As you can see on this page:

http://autoteileplus.at/phpinfo.php

 

session.save_path is still not set to /www/htdocs/xxxx/domain/temp/

 

Ask your hosting support to do it.

 

 

Also someone tells that sys_temp_dir should be set:

 

https://community.magento.com/t5/Installing-Magento-2/Could-not-determine-temp-directory-please-spec...

 

 

Stanislav

Re: Could not determine temp directory, please specify a cache_dir manually

Hello Stanislav,

 

it does not work if i:

create a new folder domain/temp

edit .htaccess "php_value session.save_path /www/htdocs/xxxx/domain/temp/"

edit file.php "    'cache_dir'=> '/temp/',          // Path to cache files" 

 

i tried everything already - without success.

 

regarding sys_temp_dir : I can not edit this file as i am using a webhosted sharedserver.

I already wrote an email to the support regarding sys_temp_dir - the answer was that they can not edit this file as it will be changed for all cutomers on the server. They told me to contact magento to find out if there is an alternative way to solve this problem.

 

i have no idea what to do...

 

Re: Could not determine temp directory, please specify a cache_dir manually

Hello,

 

Try to copy php.ini file into your website directory. So that it will affect only your website.

 

cp /etc/php56/fpm/php.ini /www/htdocs/xxxx/domain/php.ini

 

 

Then make it not readable for everyone:

 

chmod 640 /www/htdocs/xxxx/domain/php.ini

 

 

Then set your temp directory to:

 

upload_tmp_dir = /www/htdocs/xxxx/domain/temp/

 

 

in the file:

 

/www/htdocs/xxxx/domain/php.ini

 

 

Then add into .htaccess file:


SuPHP_ConfigPath /www/htdocs/xxxx/domain/

 

 

to show it location of your custom php.ini file.

 

 

 

 

Stanislav

Re: Could not determine temp directory, please specify a cache_dir manually

Hello Stanislav,

 

The point is that i can not get the php.ini from the webserver provider (all-inkl.com). 

 

Is there any other way how to find a solution?

 

I think there should be many people who are using a sharedserver without a php.ini file like me. 

 

Re: Could not determine temp directory, please specify a cache_dir manually

Hello,

 

Try to add:

ini_set('upload_tmp_dir','/www/htdocs/xxxx/domain/temp/');

 

before the line:

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);

 

in the file:

index.php

 

 

http://stackoverflow.com/questions/6479938/how-to-change-the-temp-upload-path-runtime

 

Stanislav

Re: Could not determine temp directory, please specify a cache_dir manually

Hello Stanislav!

 

ini_set in index.php also did not work out...

 

 

Is there anything else to try?

Re: Could not determine temp directory, please specify a cache_dir manually

Hello,

 

>The point is that i can not get the php.ini from the webserver provider (all-inkl.com). 

 

Does this command:

 

cp /etc/php56/fpm/php.ini /www/htdocs/xxxx/domain/php.ini

 

 

displays any error?

 

 

 

Stanislav