title: Get MD5 Checksum for Very Large Files
body: <p>I've written a script that reads through all files in a directory and returns md5 hash for each file.  However, it renders nothing for a rather large file.  I assume that the interpreter has some value set for maximum processing time, and since it takes too long to get this value, it just skips along to other files.  Is there anyway to get an md5 checksum for large files through PHP? If not, could it be done through a chron job with cpanel?  I gave it a shot there but it doesn't seem that my md5sum command has ever been processed: I never get an email with the hash.  Here's the PHP I've already written.  It's a very simple code and works file for files of a reasonable size:</p>
  
  <pre><code>function md5_dir($dir) {
      if (is_dir($dir)) {
          if ($dh = opendir($dir)) {
              while (($file = readdir($dh)) !== false) {
                  echo nl2br($file . "\n" . md5_file($file) . "\n\n");
              }
              closedir($dh);
          }
      }
  }
  </code></pre>