简体   繁体   English

Ajax请求超时太快

[英]Ajax request is timing out too quickly

I am calling my php page (test.php) through ajax request, and that test.php contains list of queries under one while loop. 我通过ajax请求调用我的php页面(test.php),而该test.php包含一个while循环下的查询列表。 When I call that page using ajax it terminates before its maximum execution time (I tried setting max value to max_execution_time, set_time_limit in ini/php file) and gives 500 internal server error. 当我使用Ajax调用该页面时,该页面在其最大执行时间之前终止(我尝试将ini / php文件中的max_execution_time,set_time_limit设置为max),并给出500个内部服务器错误。

When I call same test.php using url (and not through ajax request), it works properly. 当我使用url(而不是通过ajax请求)调用相同的test.php时,它可以正常工作。

Please help what might be the cause. 请帮助可能是什么原因。

you can try to increase your ajax timeout 你可以尝试增加你的ajax超时

jQuery.ajax({
    url: 'phpfile.php',
    success: function (result) {                               
        //
    },
    timeout: 10000
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM