yunfong Posted April 7, 2009 Share Posted April 7, 2009 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 More sharing options...
Yesideez Posted April 7, 2009 Share Posted April 7, 2009 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. Link to comment https://forums.phpfreaks.com/topic/152944-helpphp-unable-to-continue-running/#findComment-803234 Share on other sites More sharing options...
yunfong Posted April 7, 2009 Author Share Posted April 7, 2009 hi yesideez, thanks for your reply! but what do you mean by do it in chunks?? Link to comment https://forums.phpfreaks.com/topic/152944-helpphp-unable-to-continue-running/#findComment-803259 Share on other sites More sharing options...
Yesideez Posted April 7, 2009 Share Posted April 7, 2009 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) Link to comment https://forums.phpfreaks.com/topic/152944-helpphp-unable-to-continue-running/#findComment-803264 Share on other sites More sharing options...
yunfong Posted April 7, 2009 Author Share Posted April 7, 2009 thanks!! i tried it jus now but still no avail.. maybe i try smaller no of images. Link to comment https://forums.phpfreaks.com/topic/152944-helpphp-unable-to-continue-running/#findComment-803267 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.