修改apache的最大上传文件大小

时间: 2010-05-14 / 分类: 网站制作技术 / 浏览次数: 4,826 views / 0个评论 发表评论

今天看了下这个站点的统计,惨不忍睹啊
忽然想起在邮箱里还有一些采集的数据
本着不用也是浪费的原则
那就拿来用用吧
现在本机测试看看都是啥数据
下下来一看是个PHPMYADMIN的备份包,里面就是一个SQL文件,有36M大小
然后我启动了PHPNOW,访问了PHPMYADMIN,然后进去创建了一个数据库,导入数据的时候才发现了大问题
上传不了,提示是文件过大,最大只能上传32M,叫我访问帮助文档
我看了一下
1.16 I cannot upload big dump files (memory, HTTP or timeout problems).

Starting with version 2.7.0, the import engine has been re–written and these problems should not occur. If possible, upgrade your phpMyAdmin to the latest version to take advantage of the new import features.

The first things to check (or ask your host provider to check) are the values of upload_max_filesize, memory_limit and post_max_size in the php.ini configuration file. All of these three settings limit the maximum size of data that can be submitted and handled by PHP. One user also said that post_max_size and memory_limit need to be larger than upload_max_filesize.

There exist several workarounds if your upload is too big or your hosting provider is unwilling to change the settings:

* Look at the $cfg[‘UploadDir’] feature. This allows one to upload a file to the server via scp, ftp, or your favorite file transfer method. PhpMyAdmin is then able to import the files from the temporary directory. More information is available in the Configuration section of this document.
* Using a utility (such as BigDump) to split the files before uploading. We cannot support this or any third party applications, but are aware of users having success with it.
* If you have shell (command line) access, use MySQL to import the files directly. You can do this by issuing the “source” command from within MySQL: source filename.sql.

意思似乎是要嘛就要修改PHP.INI要嘛就要用FTP等功能上传到服务器,还有就是切割文件成小文件了(使用BigDump)
想了想,先尝试最简单的用FTP等功能上传到服务器,找到了PHPMYADMIN配置文件里的$cfg[‘UploadDir’],修改了
但是那个上传的页面竟然提示出错,奶奶的

看来还是修改PHP.INI实在,幸好现在是在本地操作,寻找PHP.INI文件把,找了一下,发现很奇怪的问题,似乎PHPNOW并没有使用这个文件
以前我安装过PHP.INI,里面有两个模板文件,分别在后面加了多几个字符的,现在这两个文件都好好地待在那里

难道开发那个是复制这些文件去修改的?那也应该有PHP.INI这个名称的文件才对
再仔细找找吧,功夫不负有心人,在Pn文件夹发现了Init.php,里面有个
$Cfg[‘upload_max_filesize’] = ’32M’;
$Cfg[‘post_max_size’] = $Cfg[‘upload_max_filesize’];
嘿嘿,我改,我改我改改改
$Cfg[‘upload_max_filesize’] = ’60M’;
刷新页面,没变化,还是默认的32M,嘿嘿,难不倒我
重启APACHE
果然成功了
以后有空再去研究那个所谓的BigDump吧

发表评论

您的昵称 *

您的邮箱 *

您的网站