Jump to content

Define new upload_tmp_dir


pplNet

Recommended Posts

I am using hosted server, how am I able to defind my own upload_tmp_dir.

Cos i'm having this problem, either using move_uploaded_file or copy, system always generate this error.

PHP Warning: move_uploaded_file() [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: Unable to move '/tmp/php09fLgo' to

Link to comment
https://forums.phpfreaks.com/topic/125340-define-new-upload_tmp_dir/
Share on other sites

i would suggest that it is not a tmp dir problem and i dont think you would be able to change the tmpdir without editing the php.ini file because the file would be saved to /tmp then the script would start executing.

are you specifying a full path when you copy the file i have found that sometimes uploads fail if you don't specify a full path

 

Scott.

As a side note, because the OP's original post was regarding defining a new upload_tmp_dir

If you don't have access to php.ini (which you wouldn't want to change anyway! ;) )

then you can achieve the result you want using a humble .htaccess file using the following line:

php_value upload_tmp_dir "<file path goes in here>"

 

Obviously replace the <file path goes in here> with your file path to the directory you want to write in. In most cases something like /home/httpd/vhosts/<yourdomain.com>/tmp

 

However this will not resolve the problem you are having, which appears to be either permissions based, as the folder needs to be writeable +w or 777 chmod. Also, make sure to specify a valid path...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.