Reading large files, been there, done that. The problem is that most libraries just chunk the entire document into memory which is blocking. If the file is large, the file might not be parsed before PHP either runs out of memory or execution time expires. I suggest using one of two methods.