This usually happens if the server doesn’t support the directives you added. Let’s fix that and get error reporting working for you.
Try updating your .htaccess file with the following lines:
php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_flag log_errors on
php_value error_log /home/path/public_html/domain/PHP_errors.log
Why This Works:
display_startup_errors
and display_errors
: These will ensure that PHP displays both startup and runtime errors.
html_errors
: Enables HTML formatting for the error messages.
log_errors
: Logs the errors instead of just displaying them on the page.
error_log
: Specifies the path where errors should be logged (make sure the path exists and is writable).
Key Notes:
Replace /home/path/public_html/domain/PHP_errors.log with the correct path to your public_html or the directory where you want the log file saved.
Ensure the folder permissions allow PHP to write to the log file. You may need to set permissions to 0644 for the file and 0755 for the directory.
Fallback Option: If .htaccess doesn’t work, you can add error reporting directly in your PHP script with this:
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
Let me know if you have any questions or need further help setting up the error log!