Home > Backend Development > PHP Tutorial > Unlimited transfer of attachments and cancellation of PHP upload restrictions_PHP tutorial

Unlimited transfer of attachments and cancellation of PHP upload restrictions_PHP tutorial

WBOY
Release: 2016-07-15 13:33:07
Original
891 people have browsed it

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

contains a line similar to the one below

<ol class="dp-xml"><li class="alt"><span><span class="tag"><</span><span> </span><span class="tag-name">input</span><span>   </span></span></li><li><span class="attribute">type</span><span>=</span><span class="attribute-value">"hidden"</span><span>   </span></li><li class="alt"><span class="attribute">name</span><span>=</span><span class="attribute-value">"MAX_FILE_SIZE"</span><span>   </span></li><li><span class="attribute">value</span><span>=</span><span class="attribute-value">"500000"</span><span class="tag">></span><span> </span></span></li></ol>
Copy after login

The above is the specific method to cancel PHP upload restrictions.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446084.htmlTechArticleHow to correctly 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 means POST to P through the form...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template