This article mainly describes how to use PHP to modify the size of the upload file limit, has a certain reference value, now share to everyone, the need for friends can refer to
PHP by default, only allowed to upload a certain size of files, when the upload file size exceeds this value, will be an error. This article will explain how to modify the upload file size limit in php.ini. There are three places to modify the settings, see below
1. Modify Max_execution_time
In PHP, the default page execution time is 30 seconds, more than 30 seconds, and the script stops executing.
This will make it impossible to open the Web page. Then we can modify the Max_execution_time
Look in the php.ini.
Max_execution_time
The default is 30 seconds. Change to
Max_execution_time = 0
0 means no Limit
2. Modify Post_max_size
Post_max_size sets the maximum size allowed for POST data. This setting also affects file uploads.
PHP default post_max_size is 2M. If the POST data size is larger than post_max_size $_post and $_files superglobals will be empty.
Find Post_max_size instead
Post_max_size = 150M
3. Modify Upload_max_filesize
Upload_max_filesize indicates the maximum size of the uploaded file.
Find Upload_max_filesize, default to 8M instead
Upload_max_filesize = 100M
It is also stated that the post_max_size is better than upload_max_filesize.
The above is the whole content of this article, I hope that everyone's learning has helped, more relevant content please pay attention to topic.alibabacloud.com!