Oh my God. I never thought that I would need to ask you about this. But unfortunately, yes, I need to!
I have a PHP written script that uses ffmpeg-php. And ffmpeg-php is a bastard. For some input, it works fine, but for some it breaks my entire PHP and the server produces Internal Server Error 500. I tried several times to update ffmpeg-php, ffmpeg, etc., but when for some input it works in version 0, 5 to 0.6 it will not work. And I need to make sure that the rest of the script will be processed correctly. And now this is not so, because when it comes to running toGDImage () in a movie frame, I have Internal Server Error 500 and there is no feedback why from any source.
So, for the peace of my users, I decided that I need to isolate this part of the script, which is messy with ffmpeg-php. I need a way to assure that if something goes horribly wrong in this part, it will continue.
Try catch does not work because it is not a warning and not a fatal error, it is a terrible server disaster. So what are your suggestions?
I am thinking of putting this script in another file called ffmpeg-php-process.php and calling it via HTTP and reading the result, if it is Internal Server Error 500 - I will know that this is not normal.
Or are there any other tidier ways to isolate distress scripts in PHP?
Ps. Do not write that I need to diagnose or debug or find the source of the error. I'm not a damn newbie, and I'm not a ffmpeg developer, to break into this code, I need to make my users safe now, and thatβs all I need right now.
source
share