首页 > 开发 > PHP > 正文

php解决无法上传大于2M文件的问题

2024-05-04 23:05:51
字体:
来源:转载
供稿:网友

要改php.ini,基本是改这几项:
max_execution_time = 30
max_input_time = 60
memory_limit = 8m
upload_max_filesize=8m

php.conf发现内容如下:
#
# php is an html-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

loadmodule php4_module modules/libphp4.so

addtype application/x-httpd-php php .php3

#
# cause the php interpreter handle files with a .php extension.
#

setoutputfilter php
setinputfilter php
limitrequestbody 524288


#
# add index.php to the list of files that will be served as directory
# indexes.
#
directoryindex index.php

看到那个524288吗,换算下就是512k。把它改成52428800,reload apache。经测试,可以上传几十兆的文件,问题解决。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表