douyujun0152 2013-08-02 13:53
浏览 146
已采纳

尽管upload_max_size和post_max_size设置正确,$ _FILES报告错误1(文件大小)

I'm uploading a 2MB file to my server and when I print_r($_FILES) it's reporting an error code #1, which evidently indicates a file size problem. I've already set the following in my php.ini:

post_max_size=100M
upload_max_filesize=100M

I've also verified that these changes have taken effect by displaying phpinfo(), but I'm still getting the same error. This is in an application that was moved from a shared development webhost to a dedicated VPS. It worked fine on the shared host but I'm getting the error on the VPS.

Thanks to anyone who can point me in the right direction!

  • 写回答

1条回答 默认 最新

  • doubingjiu3199 2013-08-05 05:16
    关注

    I submitted a support ticket to my webhost. Somehow the server was not responding to my php.ini file despite the proper values displaying in phpinfo(). The solution was to add the following to my .htaccess file:

    suPHP_ConfigPath /home/myaccount/public_html 
    <Files php.ini> 
    order allow,deny 
    deny from all 
    </Files>
    

    I'm not sure why this was necessary when phpinfo() reported the changes but this did the trick.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部