I have a PHP script which I am trying to run via cron. In cron I have
When the command runs, the cron log says:
Status: 500 Internal Server Error
Content-type: text/html; charset=UTF-8
However, if I simply run php /home/dir/dir/foo.php from the command line, it runs just fine with no error.
I have another PHP script in the same directory which runs correctly via cron.
Other info: The script which isn't working is located outside the document root, creates a database connection, and connects to an API.
I don't have much experience with cron, so I probably set something up wrong, but I'm puzzled why the same command would work via CLI but not in cron.