The error log location for PHP can be set both globally on the server and on a per-user basis. The exact procedure varies depending on your configuration.
Procedure
Not using PHP-FPM
In WHM
The error log location can only be set globally using WHM. To do so,
- Log into WHM
- Navigate to MultiPHP INI Editor
- Click "Editor Mode"
- Select the version of PHP you would like to set the log location for
- Find the error_log location setting
error_log = error_log
- Change the filename to the desired error log name
- Save your changes
In cPanel
The most straightforward way to set your error log location is to use the MultiPHP INI Editor in cPanel
- Log into cPanel
- Navigate to MultiPHP INI Editor
- Click "Editor Mode"
- Select a location
- Home directory will set the option for all domains, addons, and subdomains configured on the account
- A specific domain will limit the change to that domain, or, in the case of an addon domain, the addon and the matching subdomain
- Add the line
error_log = "/some/path"
This should either be a filename, with no leading path, or an exact path within your home directory - Save your changes
Using PHP-FPM
In WHM
The only way to adjust this setting is via WHM's MultiPHP Manager
- Log into WHM
- Navigate to MultiPHP Manager
- Find the domain you'd like to change the error log location for
- Click the "Edit PHP-FPM" link
- Change the log location in "The error log file (error_log)" relative to the folder "logs" within the user's home directory
- Save your changes