exec("convert -density 40 -colorspace srgb ".$incoming_path.DIRECTORY_SEPARATOR.$incomingPdf." -quality 80 ".$gen_folder_path.'med'.DIRECTORY_SEPARATOR.$incomingBaseName.".jpg");
checkSuccess($incomingBaseName.'.jpg',$gen_folder_path.'med'.DIRECTORY_SEPARATOR,'med');
exec("convert -density 15 -colorspace srgb ".$incoming_path.DIRECTORY_SEPARATOR.$incomingPdf." -quality 80 ".$gen_folder_path.'thumb'.DIRECTORY_SEPARATOR.$incomingBaseName.".jpg");
checkSuccess($incomingBaseName.'.jpg',$gen_folder_path.'thumb'.DIRECTORY_SEPARATOR,'thumb');
The above code is running the two command by using PHP, the problem is , when the first exec is running , will it go directly to checkSuccess() and go to the next exec()? Will the two exec collision ? Since the program sometimes encounter the 500 internal server error. I am wondering is this the cause?
Also, if I add a sleep() eg. 30 second, is it a good solution ? thanks.