doutu1939 2013-11-07 18:52
浏览 15

上传表格 - 无法上传/发布超过120 Kb

I am building a website with an upload form. It will upload only up to 120 Kb but the browser times out if anything bigger is tried. No error message, the browser just times out.

What I've done so far:

  1. Changed all php.ini settings, .htaccess settings;

  2. Tried different browsers;

  3. Rebuilt the form on another server (hosting company) and it works fine (removed everything from the upload except the bare basics);

This is where it starts getting weird. It works fine on my friends computer.

I think I've eliminated:

  1. The coding - because it does work;
  2. The server - because it works fine on their computers and on my friends computer
  3. The browser - Well I've used another web-hosting company and the form works fine with them, so I'm guessing it's not a browser problem, or even my internet connection problem or maybe even settings on my computer?

The problem is on my website the form won't work for anything over 120 kb. On the test website on another server it does work. It's only my computer it doesn't work on other peoples computers it does work. Why and why set at 120 kb. Am I missing something?? I'm taking this very personally, it's as if the internet, my computer, or technology just doesn't like me.

EDIT 1:

I've just tried something else. I got another computer and tried it on that to eliminate the possibility it was a problem with the computer. Still doesn't work on a different computer at my house - so I'm thinking my broadband provider? But that doesn't explain why the test website on another server works okay??

  • 写回答

3条回答 默认 最新

  • dsf5632 2013-11-07 18:56
    关注

    Review your settings in:

    php.ini

    ; Maximum size of POST data that PHP will accept.
    ; Its value may be 0 to disable the limit. It is ignored if POST data reading
    ; is disabled through enable_post_data_reading.
    ; http://php.net/post-max-size
    post_max_size=10M
    
    ; Whether to allow HTTP file uploads.
    ; http://php.net/file-uploads
    file_uploads = On
    
    ; Maximum allowed size for uploaded files.
    ; http://php.net/upload-max-filesize
    upload_max_filesize=512M
    
    ; Maximum number of files that can be uploaded via a single request
    max_file_uploads = 10
    
    ; Maximum execution time of each script, in seconds
    ; http://php.net/max-execution-time
    ; Note: This directive is hardcoded to 0 for the CLI SAPI
    max_execution_time = 30 
    
    ; Maximum amount of time each script may spend parsing request data. It's a good
    ; idea to limit this time on productions servers in order to eliminate unexpectedly
    ; long running scripts.
    ; http://php.net/max-input-time
    max_input_time = 60
    
    ; Maximum amount of memory a script may consume (128MB)
    ; http://php.net/memory-limit
    memory_limit = 128M
    

    It's important after editing php.ini file to restart your httpd server, to re-read php.ini file!

    Make sure that you set units correctly. There is no shorthand-bytes like "MB". You should use "K", "M", "G" for that. Check this PHP FAQ.

    httpd.conf or/and .htaccess

    php_value post_max_size 10M
    php_value upload_max_filesize 512M
    
    评论

报告相同问题?

悬赏问题

  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?