Jump to content

HELP!!PHP unable to continue running


yunfong

Recommended Posts

Hi,

 

Can anyone answer my probe? I have written a code running exec(" java myProgram") to generate an an grayscale image file after matching with images from my database. However, it always fail after generating 20+ image files.. I have 621 images to generate by RIGHT.

does anyone know e reason why?

is it due low memory in php or something else??

 

Please help me!! thanks for your kindness reading this.. i am very much helpless in this. i have been trying for few days but to no avail.

-----------------------------------------------------------------------

$read_cmd = fopen("match.txt","r");

      if($read_cmd) {

          exec("javac matchUploadPic3.java");

          for($x=0;$x<21;$x++) {

              $cMd = fgets($read_cmd);

          $java = popen("java matchUploadPic3 \"".$cMd."\"","r");

          usleep(100);

          clearstatcache();

        }

        pclose($java);

      }

     fclose($read_cmd);

 

part of my code

Link to comment
https://forums.phpfreaks.com/topic/152944-helpphp-unable-to-continue-running/
Share on other sites

Not sure 100% on this but I imagine your script would be running all the time but the browser is timing out.

 

You can either do them in chunks of however many images you can comfortably do in one pass or wait until someone else can provide a way to make the browser not time out.

 

Having that number of images to run through I think your best option would be to handle them in chunks.

You say you have 621 images to convert/make.

 

Why not make a loop to grab them in bunches of, say, 10 at a time then terminate the script? That way you know exactly what progress you're making, which ones have been converted and which ones haven't.

 

(10 is a guesswork figure - if your routine is intensive for each image you may want to do 5 at a time)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.