Apache实现上传大文件 首先修改php.ini,基本是改这几项:
max_execution_time = 30
max_input_time = 60
memory_limit = 8M
upload_max_filesize=8m
但改好后发现上传的文件还是不能超过512k,否则页面就出错,非常的郁闷。无论如何调大上面几项的参数都没有作用,然后又检查了httpd.conf文件,从头看了一遍还是没有发现问题。在退出conf目录的时候,偶然发现有conf.d目录,ls了一下竟看到有个php.conf。呵呵,vi 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。经测试,可以上传几十兆的文件,