Recently oneself idle of Nothing, frame a discuz forum, want to learn, system architecture idea!
But encountered a headache, is the user in the click-"Settings-" Change the avatar---"choose to upload photos
Always prompt "Can not write to the data/tmp folder!"
At first I thought it was the server's/uc_server/data/tmp directory permissions issue, whether I was FTP tool directly modify directory permissions 777,
or Chmod-r 777 data/tmp, are the same, or reported "Can not write to the data/tmp folder!".
Later I thought it might be a PHP upload configuration issue:
So the php.ini in the
Max_file_uploads
Post_max_size =100m
Upload_max_filesize =100m
File_uploads = On
Reconfigure it again!
The problem is still the same, no change!
At this time, I really anxious, I am a little tracking query, I do not believe that the problem is not found:
So tracking upload network transmission situation, found HTTP/www.geligreat.com/uc_server/index.php?m=user&inajax=1&a= uploadavatarappid=2&input=***********************
The return value is always-4
Then find the relevant code found in the/uc_server/control/user.php a fragment of code
List ($width, $height, $type, $attr) = getimagesize ($_files[' Filedata ' [' tmp_name ']);
using the GetImageSize function, and this function can only fetch the picture information in the working directory, the file outside the working directory is not obtained, but I am here in PHP upload temp directory upload_tmp_dir=/tmp, so always return-4!
Workaround: Put php.ini in upload_tmp_dir=/your site's working directory in/TMP
Of course, there may be other experts have other solutions to hope to share here, we learn together!
My technology sharing space:http://www.geligreat.com/ Welcome everyone to the top of the popular
have a little bit. http://www.geligreat.com/forum-51-1.html is a can let you relax, let you throw away a day of trouble, with a smile home, to bring a happy Holy Land for the family!
This article is from the "Give Force great" blog, please be sure to keep this source http://ljbao.blog.51cto.com/1835910/1581798
Discuz upload avatar When prompted directory is not writable can not write to the data/tmp folder!