php failed to upload image original image
General file upload, unless the file is very small. Like a 5M file, it will probably take more than a minute to upload.
But in PHP, the default maximum execution time of this page is 30 seconds. That is to say, if it exceeds 30 seconds, the script will stop executing.
This results in the inability to open the web page. At this time we can modify max_execution_time
Find
in php.ini
max_execution_time
The default is 30 seconds. Change to
max_execution_time = 0
0 means no limit
Another method is to add
in the php program
set_time_limit();
To set the maximum execution time of the page.
set_time_limit(0);//0 means no limit
2. Modify post_max_size to set the maximum size allowed for POST data. This setting also affects file uploads.
PHP's default post_max_size is 2M. If the POST data size is greater than post_max_size $_POST and $_FILES superglobals will be empty.
Find post_max_size .Change to
post_max_size = 150M
3. Many people will change the second step. But when uploading files, the maximum size is still 8M.
Why? We also need to change a parameter upload_max_filesize to indicate the maximum size of the uploaded file.
Find upload_max_filesize, the default is 8M and changed to
upload_max_filesize = 100M
Another thing to note is that post_max_size is better than upload_max_filesize.