Ok , I work at a place where I'm not allowed to touch the php.ini file because the server serves so many websites ... However, I was told that I can display php errors through htaccess so I can debug my code because right now , my PHP screen comes blank and it's not helping .. how can I display php errors through my local htaccess file without having to access php.ini ?
Asked
Active
Viewed 3,058 times
3 Answers
1
You should use:
php_flag display_errors on
in your .htaccess file
![](../../users/profiles/2842425.webp)
Cristian Bitoi
- 1,492
- 1
- 10
- 13
-
Hmm.. also, look here http://stackoverflow.com/questions/6127980/enabling-error-display-in-php-via-htaccess-only – Cristian Bitoi Oct 21 '13 at 21:34
0
You can use these commands to enable error reporting and set the error level using your .htaccess file.
php_flag display_errors on
php_value error_reporting <error level>
You can also define error reporting in some kind of php config file using error_reporting().
error_reporting(E_ALL);
![](../../users/profiles/2904996.webp)
mat
- 181
- 1
- 3
0
php_flag display_startup_errors on php_flag display_errors on php_flag html_errors on
enable PHP error logging
php_flag log_errors on php_value error_log /httpdocs/domain name/PHP_errors.log
Using htaccess, you may specify a maximum size for your PHP errors. This controls the size of each logged error, not the overall file size. Here is the general syntax:
general directive for setting max error size
log_errors_max_len integer
Ref Link : http://perishablepress.com/advanced-php-error-handling-via-htaccess/
![](../../users/profiles/1551129.webp)
Prasanth
- 46
- 5