Yii / PHP中的文件上传问题
I have a situation here, while uploading larger files(greater than 10mb
) nothing happens, no file is uploading, no db entry, no error messages etc., I'am using Yii.. phpinfo
says upload_max_filesize
and post_max_size
are 1G
and max_execution_time
is 3600
.After submitting the form, the page loads for sometime and came back to its old stage(fresh form). can't find the exact issue.
Update:
After checking server error log I got this
PHP Warning: POST Content-Length of 17481302 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
, then what to do?
update 2
The issue resolved
When you see error like that in log, you can check these values
upload_max_filesize = post_max_size =
in /etc/php.ini (not in user’s php.ini)
我有一个情况,在上传较大的文件(大于 更新: strong> p>
检查服务器错误日志后我得到了这个 p>
更新2 strong> p>
问题已解决 p>
当您在日志中看到类似的错误时,您可以检查这些值 p>
在/etc/php.ini中的upload_max_filesize = post_max_size = p>
(不在用户的php.ini中) p>
blockquote> \ n div> 10mb code>)时没有任何反应 ,没有文件上传,没有数据库条目,没有错误消息等,我使用Yii ..
phpinfo code>说
upload_max_filesize code>和
post_max_size code>是
1G code>和
max_execution_time code>是
3600 code>。提交表单后,页面会加载一段时间并返回旧阶段(新表单)。 找不到确切的问题。 p>
PHP警告:POST内容长度17481302字节超过了第0行的未知中的8388608字节的限制 code>,然后该怎么办? p>
Server Admin's Reply Regarding the issue,
When you see error like that in log, you can check these values
upload_max_filesize =
post_max_size =
in /etc/php.ini
(not in user’s php.ini
)
sorry i misunderstood the problem.here is my new answer.you are probably facing the problem because of the limited size of post_max_size
and upload_max_filesize
in your php configuration file.i.e.php.ini
so please change "post_max_size"
,upload_max_filesize
from 8M to 32M in php.ini.your problem will be solved :) and then restart your server
Check you memory_limit
. Generally, memory_limit
should be larger than post_max_size