Home > Article > Backend Development > Unlimited transfer of attachments and cancellation of PHP upload restrictions_PHP tutorial
How to correctly cancel
Cancel PHP upload restrictions 1. Modify the PHP.ini file.
Find the PHP.ini file in PHP and open it with WordPad:
1. Find post_max_size, which refers to the maximum value that PHP can receive through form POST, including forms. All values in , the default is 8M, you need to change it according to your own needs.
2. Find File Uploads, first confirm file_uploads = on; whether to allow file uploading via HTTP switch, the default is ON. upload_tmp_dir;
Find upload_max_filesize; that is, the maximum size of files allowed to be uploaded. The default is 2M.
3. If you want to upload a file >8M, it may not be possible to just set the above four items. It is best to also set the following parameters:
Look for max_execution_time = 600; the maximum time value (seconds) for each PHP page to run, the default is 30 seconds.
max_input_time = 600; The maximum time required for each PHP page to receive data, default 60 seconds.
memory_limit = 8M; The maximum memory consumed by each PHP page, the default is 8M.
Cancel PHP upload restrictions 2. Modify the PHPmyadminimport.PHP file. (Note: This is for setting up PHPmyadmin. If your database is large, you can back up the database through this method instead of volume backup)
Open import.PHP with WordPad File:
1. Find $memory_limit, the default is $memory_limit = 2 * 1024 * 1024; modify it yourself.
2. There are the same statements in the three or four lines below. Modify them yourself.
Cancel PHP upload restrictions 3. It still doesn’t work here, it’s an IIS problem.
1) Solution to the problem of being unable to upload large-capacity files in IIS 6.0:
1. First, close the iis admin service service in the service.
2. Find the metabase.xml file under windowssystem32inetsrv.
3. Open it with WordPad, find ASPMaxRequestEntityAllowed and modify it to the required value (default: 204800, that is: 200K).
4. Save, then restart the iis admin service service and restart IIS.
2) Solve the problem that attachments exceeding 4M cannot be downloaded in IIS 6.0. Steps:
1. First, close the iis admin service service in the service.
2. Find the metabase.xml file under windowssystem32inetsrv.
3. Open it with WordPad, find AspBufferingLimit and modify it to the required value (default: 4194304, that is: 4MB).
4. Save, then restart the iis admin service service and restart IIS.
OK, with the above three steps, PHP’s 2M limit is completely solved!
Solution to cancel PHP upload limit:
View the following lines in PHP.ini:
upload_max_filesize = 8M
post_max_size = 10M
memory_limit = 20M
Also make sure that the uploaded