0
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.

user782104
  • 13,233
  • 55
  • 172
  • 312
  • Also, I can not simply using error_reporting (E_ALL) to check the error cause, it will redirect to the error page. – user782104 Mar 19 '13 at 08:21
  • A 500 status code means that your script is throwing an error but you haven't configured PHP to display error messages. That's something you need to fix before you go further; it's impossible to code without the aid of error messages. Here's a [brief explanation](http://stackoverflow.com/a/5680885/13508). – Álvaro González Mar 19 '13 at 08:22
  • Thanks, it will redirect to the Server Error page? – user782104 Mar 19 '13 at 08:23
  • Have you checked the web server's error log? – Álvaro González Mar 19 '13 at 08:23
  • I am afraid i can not access it , is it the only way to do checking ? – user782104 Mar 19 '13 at 08:27
  • 1
    I'd say you're developing directly on the live site and such site is configured to hide error messages at all cost, which is OK in a live site. As I said, it's impossible to do serious coding if you can't even see error messages. You should configure a local stack and develop in a computer you have full control on. Meanwhile, you should at least try to enable "log_errors" and "error_log" so you can send logs to a file you can actually read. – Álvaro González Mar 19 '13 at 08:38
  • Thanks, I look at the log first then – user782104 Mar 19 '13 at 08:49

0 Answers0