this may sound odd. Is there logging in the php script?
What is meant by logging?
writing to a file
That starts at line 17?
When you run it manually, you trigger it through the command line as well?
Use the absolute path for the require_once file.