• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

PHP CLI Question and Memory Usage

robdog

Well-known member
#1
I have PHP script that I run through CLI and it is using A LOT of memory. (but it is doing a ton of work)

What techniques should I use to free up memory during the CLI processing?
 

Shamil

Well-known member
#4
I'm generally scared of things like this:

PHP:
foreach ($array as $key => $data){
     $query = "UPDATE ...";
     $db->query($query);
}
Have you profiled your script?