PHP cannot find temporary folders when uploading files how to resolve

Source: Internet
Author: User
Tags html form
Recently encountered such trouble, unable to find the temporary folder returned by the error code is 6. This article mainly and everyone introduced the PHP upload can not find temporary folder solution, the main processing method is to find PHP configuration file php.ini and make the corresponding changes, the specific solution for everyone reference under this article, I hope to help everyone.

Cause of Error:

One, the configuration file does not have a temporary folder set

Second, the temporary folder does not have or the parent folder does not have the appropriate permissions

Processing method:

Locate the PHP configuration file php.ini, and locate the following code

;upload_tmp_dir =


Upload_tmp_dir = "C:/windows/temp"  //The following folder path is set according to your system

If the permissions are insufficient, you can add the appropriate permissions to the files according to the operating system.

Other knowledge:


The value is 0, no error occurred and the file upload was successful.

The value is 1 and the uploaded file exceeds the upload_max_filesize option limit in php.ini.

Its value is 2, and the size of the uploaded file exceeds the value specified by the MAX_FILE_SIZE option in the HTML form.

The value is 3, and the file is only partially uploaded.

Its value is 4 and no files are uploaded.

The value is 6 and the Temp folder cannot be found. PHP4.3.10 and PHP5.0.3 introduced.

The value is 7, and the file write fails. PHP5.1.0 introduced.

If the newspaper is wrong, it should be temporary folder does not have write permission or does not exist

Related recommendations:

php-ask for PHP System Temp folder problem

Related Article

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: 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.