php - Script looking for string in file breaks -


O people, I'm running a script that looks for a specific word in a PDF file. Well, actually I'm reading PDF file as a txt file and I'm looking for the word there. The script processes 20k files but, unexpectedly, after hitting the file the script is broken, which is longer than 50 MB. It stops.

What could be the reason? Here is an excerpt of the script:

  // If file exists then go ahead (file_exists ($ sourcePath)) {resonant "file exists \ n"; If (files ($ sourcePath) gt; 0) {resonant "files are greater than 0 \ n"; $ PdfFile = fopen ($ sourcePath, "rb"); $ Data = Fred ($ pdfFile, filesize ($ sourcePath)); Fclose ($ pdfFile); // Find the string if (Stripos ($ data, $ exploration)) {resonance "success. Encrypt found \ r \ n"; Fwrite ($ errorFileHandler, "success encrypt code found \ r \ n"); } And {.....} ... ...  

What could be the problem?

O people, I thought it. There was not enough memory set for PHP error log in error is a fatal error that the script is out of memory.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -