Home php教程 php手册 无限传输附件 取消PHP上传限制

无限传输附件 取消PHP上传限制

Jun 13, 2016 am 11:10 AM
php php.ini one upload transmission Revise Cancel how accomplish unlimited correct of appendix limit

如何正确的实现取消

取消PHP上传限制一、修改PHP.ini文件。

找到PHP中的PHP.ini文件,用写字板打开:

1、查找post_max_size,指通过表单POST给PHP的所能接收的最大值,包括表单里的所有值,默认为8M,看你自己需要进行改变。
2、查找File Uploads,首先确认file_uploads = on ;是否允许通过HTTP上传文件的开关,默认为ON即是开。 upload_tmp_dir ;
查找upload_max_filesize ;即允许上传文件大小的最大值。默认为2M。
3、如果要上传>8M的文件,那么只设置上述四项还不定一定可以。最好对下面的参数也进行设置:
查找max_execution_time = 600 ;每个PHP页面运行的最大时间值(秒),默认30秒。
max_input_time = 600 ;每个PHP页面接收数据所需的最大时间,默认60秒 。
memory_limit = 8M ;每个PHP页面所吃掉的最大内存,默认8M。

取消PHP上传限制二、修改PHPmyadminimport.PHP文件。(注:这是设置PHPmyadmin的,如果你的数据库很大的情况可以通过这个办法将数据库备份下来,而不再是分卷备份)

用写字板打开import.PHP文件:
1、查找$memory_limit,默认为$memory_limit = 2 * 1024 * 1024;自己修改。
2、下边三四行的位置有同样的语句,自己修改。

取消PHP上传限制三、到这里还不行,IIS的问题。

1)解决在 IIS 6.0 中,无法上传大容量文件的办法:

1、先在服务里关闭 iis admin service 服务。
2、找到 windowssystem32inetsrv 下的 metabase.xml 文件。
3、用写字板打开,找到 ASPMaxRequestEntityAllowed 把它修改为需要的值(默认为:204800,即:200K)。
4、存盘,然后重启 iis admin service 服务,重启IIS。

2)解决在 IIS 6.0 中,无法下载超过4M的附件步骤:

1、先在服务里关闭 iis admin service 服务。
2、找到 windowssystem32inetsrv 下的 metabase.xml 文件。
3、用写字板打开,找到 AspBufferingLimit 把它修改为需要的值(默认为:4194304,即:4MB)。
4、存盘,然后重启 iis admin service 服务,重启IIS。

OK,有以上三步,PHP的2M限制完全搞定!

取消PHP上传限制的解决方法: 

在PHP.ini里面查看如下行:
upload_max_filesize = 8M
post_max_size = 10M
memory_limit = 20M

另外要确认上传的

里类似下面的这行

<ol class="dp-xml">
<li class="alt"><span><span class="tag"><span> </span><span class="tag-name">input</span><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>
</li>
</ol>
Copy after login

以上就是取消PHP上传限制的具体方法介绍。


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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

In this chapter, we are going to learn the following topics related to routing ?

CakePHP Working with Database CakePHP Working with Database Sep 10, 2024 pm 05:25 PM

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

See all articles