0

几天后我面临读取超时问题。

  1. 在我的应用程序中有一个上传用户的工具(Xls、xlsx 是允许的扩展名)。这完全是管理面板。
  2. 我正在使用 PHPExcel 从工作表中读取数据并将每行详细信息动态插入数据库。
  3. 在这里,可以上传大尺寸文件。现在我拥有的文件是 16MB 文件,其中包含近 20 万条记录。
  4. 我通过 htaccess 增加了以下配置

    php_value memory_limit 1024M

    php_value max_execution_time 259200

    php_value max_input_time 3000

    php_value post_max_size 700M

    php_value upload_max_filesize 100M

我也将 set_time_limit(0) 放在特定的控制器中。

我的问题是生产环境中的读取超时。它正在执行大约 15 分钟并返回以下错误

The requested URL could not be retrieved

While trying to retrieve the URL: http://example.com/upload/url

The following error was encountered:

    Read Timeout 

The system returned:

    [No Error]

A Timeout occurred while waiting to read data from the network. The network or server may be down or congested. Please retry your request.

Will Keep Alive 在这里做点什么。在生产环境中设置为 5,Apache 超时时间为 300。

我在这个网站上搜索了许多类似的错误帖子,但没有运气

我打算设置一个 cron 作业,只从前端上传文件。希望能解决这个问题,但我也想知道是什么因素导致了这个错误。

4

0 回答 0