PHP Script memory optimization — Need to reduce amount of memory required to run script

QuestionsPHP Script memory optimization — Need to reduce amount of memory required to run script
Jehal Desai Staff asked 14 years ago

Here is my dilema, I have a rather large PHP script, that basically reads several XML files and parses them all into my database. It works excellent in my dev environment, however it always causes an apache 500 error when I try and run it on GoDaddy's servers. I suspect it is because this script uses a lot memory. When I run it in dev, apache's memory usage increases to almost 250mb. I've done everything I can think of to reduce the memory required by the script, and help would be much appreciated!
The file that is read by the getDeals() method has about 50,000 items in it..


View on Stack Overflow