我几天都面临读取超时问题 .

  • 有一个工具可以在我的应用程序中上传用户(Xls,xlsx是允许的扩展名) . 这完全是管理员面板 .

  • 我正在使用PHPExcel从工作表中读取数据并将每行详细信息动态插入到数据库中 .

  • 在这里,可以上传大尺寸文件 . 现在我拥有的文件是16MB文件,其中包含近20万条记录 .

  • 我通过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作业,只从前端上传文件 . 希望能解决这个问题,但我也想知道导致这个错误的因素是什么 .