Help - Search - Members - Calendar
Full Version: Allowed memory size exhausted :(
Weborum Webmaster Forum > Web Page Design > PHP
morrowasted
Okay, so I have a 1.694 Megabyte text file (heh). I tried to run this script on it:

<?
$fp = fopen("pass1.txt", 'r');
$cool = fread($fp, filesize("pass.txt"));
$neat = explode(" ", $cool);
foreach($neat as $word) {
echo $word . ": " . md5($word) . "<br />";
}
?>

And I recieved this depressing error:
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 9 bytes) in /home/httpd/vhosts/morrowasted.com/httpdocs/md5er.php on line 4

Is there ANYTHING I can do besides divide it into a bunch of text files?

EDIT:Also, changing it to "$cool = fread($fp, 8388606);" or similar does not work either.
Timo
While I have very little knowledge of this sort of thing (I rarely touch flat files and the sort). Try setting the max file size to a larger number in php.ini. If you don't have access to that I think you're out of luck though.

-Tim
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.