How to enable php errors in wordpress htaccess file

Solution:1

Below will be for php-fpm

Step 1 : add .user.ini on root directory where you can find wp-config.php

Step 2 : add below code in the above file

 display_errors = On
 display_startup_errors = On
 html_errors = 1
 error_reporting = -1

Now if you are using mod_php then add below code in .htacess

php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_flag log_errors on
php_flag ignore_repeated_errors off
php_flag ignore_repeated_source off
php_flag report_memleaks on
php_flag track_errors on
php_value docref_root 0
php_value docref_ext 0
php_value error_log /directory_path/errors.log
php_value error_reporting -1
php_value log_errors_max_len 0

Adding phpinfo();  will help you to find that which (mod_php or php-fpm) has been under use.

Solution:2

In wordpress you can enable errors in wp-config.php:

define('WP_DEBUG', true);