简体   繁体   English

PHP更改最大文件大小上传

[英]PHP Change Max File Size Upload

I am developing a web site.我正在开发一个网站。 It will be deployed offline.它将离线部署。 It's just like a interface for image and video storage.它就像一个用于图像和视频存储的接口。

When I upload files, this is what happens.当我上传文件时,会发生这种情况。 Show Image显示图像

在此处输入图像描述 It exceeds the maximum file size.它超过了最大文件大小。 I want to change the maximum file size anywhere I deploy it.我想在部署它的任何地方更改最大文件大小。 Any ideas how to do it ?任何想法如何做到这一点?

using .htaccess file in the root directory, you can increase the maximum upload size使用根目录下的 .htaccess 文件,可以增加最大上传大小

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

other way change php.ini file其他方式更改 php.ini 文件

upload_max_filesize = 128M
post_max_size =64M
max_execution_time = 300
max_input_time = 300

You need to change the following settings in your php.ini file您需要在 php.ini 文件中更改以下设置

; Maximum allowed size for uploaded files.
upload_max_filesize = 40M

; Must be greater than or equal to upload_max_filesize
post_max_size = 40M

转到xampp/php/php.ini,使用文本编辑器打开php.ini,找到这一行upload_max_filesize=,设置你想要的文件大小

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM