AGI Script completed returning -1


I’m running a few PHP scripts in dialplan of my Asterisk Some of them connect to SQL, some not, but the common thing is that sometimes (less than 0,1%, but still) they fail, returning -1. What does -1 status mean for a PHP script, is it somehow possible to track what exactly happens?