0

我正在使用 PHP ajax 函数使用 Twitter API 将 Twitter 关注者加载到数据库中,在关注者数量众多的情况下,处理需要很长时间,并且在完成进程之前出现 404 页面未找到错误。

如何解决这个问题

4

3 回答 3

0

You have to increase execution time. It can be done in 2 ways

  1. Set the value in script
  2. Set the value in php.ini file

Set the value in your script

ini_set('max_execution_time', 300); //300 seconds = 5 minutes

Copy and paste the above code in to your applications config file or index.php or on a specified file.

Set the value in php.ini file

Open your php.ini file in notepad. Search for the string max_execution_time. Change its value into 300. (You can find the file in your c:/wamp/bin/php folder)

于 2013-08-29T05:32:40.637 回答
0

您可以增加允许执行脚本的时间:http: //php.net/manual/de/function.set-time-limit.php

注意你在 php.ini 中的 max_execution_time

但是我不建议您在前端执行此操作,那么这听起来更像是您的脚本的性能问题。没有用户愿意等待超过 4 秒的网站。2秒也太长了。

于 2013-08-29T05:02:51.317 回答
0

我将 max_execution_time 设置为 0 仍然发现问题。我猜这个问题与 Apache 服务器超时有关。每次插入数据库及其工作后,我都会回显“某事”。

Sametime 我在前端页面中发现了另一个问题,“内部服务器错误 500”,但用于插入的 ajax 进程仍在进行中。

于 2013-08-30T10:06:40.030 回答