<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="http://www.majordojo.com/projects/FeedManager/atom.xsl" type="text/xsl" media="screen"?>
<feed xmlns="http://www.w3.org/2005/Atom" 
      xmlns:thr="http://purl.org/syndication/thread/1.0">
  <link rel="alternate" type="text/html" href="http://www.thinkjam.org/zoptuno/archives/2004/09/erhas3aeapache2.html" />
  <link rel="self" type="application/atom+xml" href="http://www.thinkjam.org/zoptuno/archives/2004/09/erhas3aeapache2.html" />
  <id>tag:www.thinkjam.org,2009:/zoptuno//2/tag:www.thinkjam.org,2004:/zoptuno//2.22-</id>
  <updated></updated>
  <title>Comments for 解决RHAS3中Apache2的PHP上传文件大小的限制</title>
  <subtitle>My think. My dream.</subtitle>
  <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.31-zh-cn</generator>
  <entry>
    <id>tag:www.thinkjam.org,2004:/zoptuno//2.22</id>
    <link rel="alternate" type="text/html" href="http://www.thinkjam.org/zoptuno/archives/2004/09/erhas3aeapache2.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.thinkjam.org/loveblog/batom.cgi/weblog/blog_id=2/entry_id=22" title="解决RHAS3中Apache2的PHP上传文件大小的限制" />
    <published>2004-09-03T08:23:21Z</published>
    <updated>2008-01-27T06:56:21Z</updated>
    <title>解决RHAS3中Apache2的PHP上传文件大小的限制</title>
    <summary>近日将论坛从VBB2升级到VBB3，将上传附件大小设置为2M，可每次上传超过50...</summary>
    <author>
      <name>平生一笑</name>
      <uri>http://www.thinkjam.org/zoptuno</uri>
    </author>
    
    <category term="服务器" />
    
    <content type="html" xml:lang="en" xml:base="http://www.thinkjam.org/zoptuno/">
      <![CDATA[<p>近日将论坛从VBB2升级到VBB3，将上传附件大小设置为2M，可每次上传超过500K的附件都会出错，而之前使用VBB2时却正常。</p>

<p>经过仔细检查，终于发现了问题所在，今日放出，与诸君共赏。。。</p>]]>
      <![CDATA[<p>首先我仔细检查了php.ini，其中的upload_max_filesize=8m，没有任何问题，然后将其中的<br />
<blockquote>max_execution_time = 30  <br />
max_input_time = 60<br />
memory_limit = 8M</blockquote><br />
数值分别调大到120、180、32M，还是没有任何作用，令人非常头痛！</p>

<p>然后开始怀疑是http.conf配置文件出现的问题，但从头到尾检查了一遍也没发现任何异相，此问题只能搁置。</p>

<p>有一天需要给服务器加入一个子域名，去更改/etc/httpd/conf.d/文件夹下的access.conf文件，发现此文件夹下还有一个php.conf，赶忙打开，里面是如下内容：<br />
<blockquote>#<br />
# PHP is an HTML-embedded scripting language which attempts to make it<br />
# easy for developers to write dynamically generated webpages.<br />
#</p>

<p>LoadModule php4_module modules/libphp4.so</p>

<p>AddType application/x-httpd-php php .php3</p>

<p>#<br />
# Cause the PHP interpreter handle files with a .php extension.<br />
#<br />
&lt;Files *.php><br />
    SetOutputFilter PHP<br />
    SetInputFilter PHP<br />
    LimitRequestBody 524288<br />
&lt;/Files></p>

<p>#<br />
# Add index.php to the list of files that will be served as directory<br />
# indexes.<br />
#<br />
DirectoryIndex index.php</blockquote><br />
LimitRequestBody 524288中的524288正好跟512KB相等，将其更改为2097152，不能上传超过2M附件的问题解决！</p>

<p>再回忆一下，发现以前用VBB2时的操作系统为RHAS 2.1，用的自带的Apache 1.x版本，后来升级成VBB 3之前，顺便也把系统更换为RHAS3，而RHAS3自带的Apache为2.x版本，其配置文件的组织方式有所改变，也许自己编译安装的Apache就不会出现此种问题，可自己比较懒，不喜欢编译，呵呵 。</p>

<p>希望上述能对大家有用吧，可能很多高手并不会碰到。</p>]]>
    </content>
  </entry>

</feed>
