Where are PHP errors logged when a script is called from another program?

When a PHP script is called from another program, PHP errors are typically logged to the default PHP error log file specified in the php.ini configuration. To ensure that errors are logged properly, you can set the error_log directive in your script to specify a custom error log file location.

// Set custom error log file location
ini_set('error_log', '/path/to/custom/error.log');

// Your PHP script code here