PHP errors can display directly on the site or commit them to the log for further analysis.
Depending on the internal structure of the site and the type of problem encountered, the output or logging of PHP errors may not always help to identify the causes of problems on the site. In some cases, it may be more useful to enable debugging mode using the tools of the site itself (as, for example, in WordPress, Joomla!, PrestaShop) or manual addition of debugging directives by a developer or a specialized specialist to his code, allowing you to track at what stage and for what reason an error occurs.
The PHP parameter is responsible for the types of displayed errors. error_reporting.
To customize the error output, do the following:
PHP error logging can be done in different ways - both by means of hosting and at the level of site scripts.
ini_set("log_errors", 1); ini_set("error_log", "/path/to/logu/php-error.log");
As a result, if a PHP error occurs during the operation of this script, it will be written to the log at the specified path.