1

i am having trouble seeing PHP Errors with my new Web Server.

Everytime i have an error message i am getting the message 'HTTP-Error 500 (Internal Server Error)' Is there any way to enable the error reporting? The error_reporting(E_ALL); line does not work.

Styler2go
  • 604
  • 2
  • 12
  • 32

4 Answers4

2

You need to check the error logs that correspond to your web server. Ensure that you have allowed your web server write privileges to the directory of your log files. You can find the location of your log files by checking th error_log variable in your php.ini file.

See here for more information.

Community
  • 1
  • 1
Kyle
  • 4,202
  • 1
  • 33
  • 41
  • I want to see the error directly in the Browser, not in an error_log. Is that not supported anymore? – Styler2go Jan 19 '13 at 22:17
  • I haven't tested this, but this [link](http://stackoverflow.com/a/6096014/616937) might help. The gist is to ensure that display_errors = On – Kyle Jan 19 '13 at 22:18
  • I found the solution. I've searched for ´display_´ and found, that the display_error was off. After enabling it it worked fine. Thanks! – Styler2go Jan 19 '13 at 22:20
1

Set error_reporting(-1); and ini_set('display_errors', 'On'); This will show your errors. Also make sure your error_log php.ini settings is not set to syslog or a file-name.

Shiplu Mokaddim
  • 56,364
  • 17
  • 141
  • 187
0

To let the server print php error, you can use ini_set() method inside the code. Okay!

Alternativly you can change the php.ini config file. open the file and look for errors and warnings, in this section, you can configure the behavier when a error occured.

zeyorama
  • 444
  • 3
  • 12
0

You may try htaccess for activating error reporting.

# PHP error handling for development servers
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 /home/path/public_html/domain/PHP_errors.log
# [see footnote 3] # php_value error_reporting 999999999
php_value error_reporting -1
php_value log_errors_max_len 0

<Files PHP_errors.log>
 Order allow,deny
 Deny from all
 Satisfy All
</Files>

Source: http://perishablepress.com/advanced-php-error-handling-via-htaccess/

aiternal
  • 1,080
  • 3
  • 16
  • 33