I have a script that is being called by a 3rd party script, but it doesn't work. I can see in the logs that the file is in fact being called, just nothing happends.
How do you debug a file called by a 3rd party?
- I can't call the file from the commandline / another file, due to security checks
- The 3rd party is an automated process, I can not ask them for help
- I do not know if the code works properly, doesn't do a thing, or it has an error
- This is an older site (or consider a less pro website), proper errorhandling does not exist
Best solution thusfar:
Place a bunch of
file_put_contents($loc.'/a-1.txt', '') (where the
1 increments every time used) and see how many files are created/updated when you let the script excecute.
This is slow, and only gives me how the code flows, not actual errors, so this isn't very efficient.
I've found some topics talking about changing STDIN, STDOUT and STDERR, but I can't seem to get those to work out of the box.