This should happen by default if you are using CGI as the PHP handler. Can you browse to WHM >> MultiPHP Manager and confirm if PHP-FPM is enabled for the domain you are testing with?
@cPanelMichael thank you. I always thought having the error_log file in the same directory as the script that throws error was default behavior when using CGI as the PHP handler as well. However this doesn't seem to the case on my install. The PHP-FPM option is turned off for all domains.
I created a test account/domain on a server running cPanel & WHM version 80.0.20 and selected CGI as the PHP handler. Upon generating a PHP error in a test PHP script, the error_log file was generated in the document root of the PHP script.
Could you open a support ticket so we can take a closer look at your system? You can post the ticket number here once it's opened and I'll link this thread to it.
Thank you. I think I have managend to narrow it down to the MPM. Only when the prefork MPM is used a error_log file is created in the same directory as the script that throws the error. Is this right? Or should this also work when any of the other MPM's are used?
Upon testing with the Worker and Event MPMs, I can confirm you are correct. The Prefork MPM is required for direct logging to the individual PHP error_log file under the website's document root directory. With the Worker and Event MPMs, the PHP errors are logged directly to the Apache error log (/usr/local/apache/logs/error_log).