Discuz upload avatar When prompted directory is not writable can not write to the data/tmp folder!

Source: Internet
Author: User
Tags tmp folder

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.