Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem when php5.6 uploads pictures with error code of 6 or reports an error?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains the "php5.6 upload picture error code for 6 or report error how to solve", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "php5.6 upload picture error code for 6 or error report how to solve" it!

Problem: when uploading pictures using webuploader, I found that I reported an error and printed $_ FILES ["file"] ["error"]. It was found to be 6, and the temporary folder could not be found.

There are several types of $_ FILES ['file'] [' error']:

1 、 UPLOAD_ERR_OK

Its value is 0, no error occurred, and the file was uploaded successfully.

2 、 UPLOAD_ERR_INI_SIZE

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

3 、 UPLOAD_ERR_FORM_SIZE

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.

4 、 UPLOAD_ERR_PARTIAL

Its value is 3, and only part of the file is uploaded.

5 、 UPLOAD_ERR_NO_FILE

Its value is 4, and no files have been uploaded.

6 、 UPLOAD_ERR_NO_TMP_DIR

Its value is 6 and the temporary folder cannot be found. PHP4.3.10 and PHP5.0.3 were introduced.

7 、 UPLOAD_ERR_CANT_WRITE

Its value is 7 and the file write failed. The introduction of PHP5.1.0.

Solution:

1. First check whether the temporary folder is set in php.ini of PHP and the upload_tmp_dir option of php.ini. (whether it has been commented or set up a temporary file)

2. If a temporary file is set, check whether the permissions have read and write permissions.

Linux:chmod-R0777/tmp

Windows: sets C:/temp directory permissions everyone can read and write.

3. Restart the server apache

Sudoapachectlrestart

Thank you for your reading, the above is the "php5.6 upload picture error code 6 or report errors how to solve" the content, after the study of this article, I believe you upload pictures on php5.6 error code 6 or report errors how to solve this problem has a deeper understanding, the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report