为什么我的服务器不能接受大于2MB的文件? [英] Why won't my server accept files larger then 2MB?

查看:358
本文介绍了为什么我的服务器不能接受大于2MB的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行XAMPP的VPS,并为我制作的iPhone应用程序提供服务。



我使用 ASIHTTPRequest 服务器。



应用程序将文件发送到服务器,服务器只接受那些轻于2MB的用户。



我也用Wireshark进行了检查,发现这个警告:

PHP致命错误:在c:/ xxx / index中超过60秒的最大执行时间。在第二行中的php

我写道: session_start();

在我的理论中,它们是阻止大文件进入我的服务器的两件事情:
$ b $ ol <

  • 某种文件大小限制

  • 每次操作的时间限制

  • 我真的需要帮助。谢谢!

    解决方案

    检查 php.ini ,在运行XAMPP时,可以在 * root * / php / 目录中找到

    。 code>#确保文件上传已打开
    file_uploads =开启

    #将最大上传大小更改为100Mb
    upload_max_filesize = 100M

    #将最大文章大小更改为100Mb
    post_max_size = 100M

    #将最大上传时间更改为900秒
    max_input_time = 900

    #在脚本执行超时的情况下,您正在看到自己的问题。
    #将脚本的最大执行时间更改为900秒
    max_execution_time = 900


    I have a VPS that runs XAMPP and gives service to an iPhone App that I made.

    I used ASIHTTPRequest to upload files to the server.

    The App sends files to the server, and the server accept only those who are lighter then 2MB.

    I also checked with Wireshark and found this warning:

    PHP Fatal error: Maximum execution time of 60 seconds exceeded in c:/xxx/index.php in line 2

    in line 2 I wrote: session_start();

    in my theory they are 2 things that block big files from entering my server:

    1. Some kind of file size limit
    2. Some kind of time limit per action

    I really need help on this one. Thanks!

    解决方案

    Check the settings in your php.ini file which, when running XAMPP, can be found in the *root*/php/ directory.

    #Make sure file uploads are turned on
    file_uploads = On
    
    #Change the max upload size to 100Mb
    upload_max_filesize = 100M
    
    #Change the max post size to 100Mb
    post_max_size = 100M
    
    #Change the max upload time to 900seconds
    max_input_time = 900
    
    #This is where you are seeing your problem as the script execution is timing out.
    #Change the max execution time of the script to 900 seconds
    max_execution_time = 900
    

    这篇关于为什么我的服务器不能接受大于2MB的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆