douyujun0152 2013-08-02 21:53
浏览 145
已采纳

尽管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 13: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.

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

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog