使用PHP MYSQL处理大型CSV文件 [英] Processing Large CSV files using PHP MYSQL

查看:96
本文介绍了使用PHP MYSQL处理大型CSV文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个PHP/MySQL应用程序,该程序需要处理CSV文件,但是脚本始终在整个过程完成之前停止.

I am developing a PHP/MySQL application which entails processing of CSV files but the script always stops before the entire process is completed.

如何优化系统以最终解决此问题?

How can I optimize the system to conclusively handle this?

请注意,我不会对此系统进行虚拟主机托管,因此无法延长PHP的最大执行时间.

Note I wont be doing the webhosting for this system so I cant be able to extend the PHP maximum execution time.

谢谢

推荐答案

一些想法.

  1. 将文件拆分为一个行集合,您知道可以一次性进行处理.启动多个进程.

  1. Break the file down into a row set that you know you can process in once shot. Launch multiple processes.

分解工作,以便可以通过几步进行处理.

Break down the work so that it can be handled in several passes.

这篇关于使用PHP MYSQL处理大型CSV文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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