Php fails to upload the source image. Php fails to upload the original image, unless the file is small. like a 5 MB file, it may take more than one minute to complete the upload. however, in php, the longest execution time of this page is default.
An error occurred while uploading the image in php.
Generally, unless the file is very small, it is like a 5 MB file. it may take more than one minute to complete the upload.
However, in php, the longest execution time of the page is 30 seconds by default. that is to say, the script is stopped after 30 seconds.
This causes the web page to fail to be opened. in this case, we can modify max_execution_time.
Search in php. ini
Max_execution_time
The default value is 30 seconds.
Max_execution_time = 0
0 indicates no limit
Another way is to add
Set_time_limit ();
To set the longest page execution time.
Set_time_limit (0); // 0 indicates no limit
2. modify post_max_size to set the maximum size allowed by POST data. This setting also affects file upload.
The default post_max_size of php is 2 MB. if the size of POST data is larger than that of post_max_size $ _ POST and $ _ FILES superglobals, it is null.
Change to post_max_size.
Post_max_size = 150 M
3. many people will change the second step. but the maximum size of the file to be uploaded is 8 MB.
Why? we need to change the parameter upload_max_filesize to indicate the maximum size of the uploaded file.
Find upload_max_filesize. the default value is 8 MB.
Upload_max_filesize = 100 M
In addition, post_max_size is better than upload_max_filesize.
Upload an ordinary file, unless the file is small. like a 5 MB file, it may take more than one minute to complete the upload. but in php, the longest execution time of this page is by default...