prabhasgupte Posted May 17, 2009 Share Posted May 17, 2009 I am using WAMP5 on Windows Vista. I am writing a web crawler in PHP. My script loops through the links to crawl (fetched from MySQL database) and parses each web page for finding next to-crawl links. Everything works fine for initial few number of links, and then suddenly my script exits with a fatal error. The error message I get is: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 408 bytes) in C:\wamp\www\cybrevo\inarad\simple_html_dom.php on line 643 (I am using simple_html_dom.php script available on Internet to get list of hyperlinks.) I am unable to fix up this problem. If you know any remedy for this, please let me know. I am stuck with this problem. Quote Link to comment https://forums.phpfreaks.com/topic/158455-solved-fatal-error-allowed-memory-size-of-8388608-bytes-exhausted/ Share on other sites More sharing options...
BK87 Posted May 17, 2009 Share Posted May 17, 2009 very top of your code put this, after <?php ini_set("memory_limit","100MB"); or locate your php.ini file then open it, and change the memory_limit to like 100mb... Quote Link to comment https://forums.phpfreaks.com/topic/158455-solved-fatal-error-allowed-memory-size-of-8388608-bytes-exhausted/#findComment-835664 Share on other sites More sharing options...
prabhasgupte Posted May 17, 2009 Author Share Posted May 17, 2009 I tried this, but did not work. I am still getting the same error message. ??? Quote Link to comment https://forums.phpfreaks.com/topic/158455-solved-fatal-error-allowed-memory-size-of-8388608-bytes-exhausted/#findComment-835666 Share on other sites More sharing options...
BK87 Posted May 17, 2009 Share Posted May 17, 2009 you will def have to go into your php.ini and change it manually... and restart apache by the way after you reconfigure php.ini Quote Link to comment https://forums.phpfreaks.com/topic/158455-solved-fatal-error-allowed-memory-size-of-8388608-bytes-exhausted/#findComment-835669 Share on other sites More sharing options...
prabhasgupte Posted May 17, 2009 Author Share Posted May 17, 2009 If I run script in browser.. the problem is solved. but if I run the same script on command prompt, I still get the error message. Its OK for now to run from browser, but later I want to run this script as cron job. So, need to have some remedy for command prompt option. Quote Link to comment https://forums.phpfreaks.com/topic/158455-solved-fatal-error-allowed-memory-size-of-8388608-bytes-exhausted/#findComment-835672 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.