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.

asked Jan 19, 2013 at 22:06
5
  • Are you using IIS or Apache? Commented Jan 19, 2013 at 22:07
  • Have you checked your webserver logs? Commented Jan 19, 2013 at 22:07
  • 1
    Try setting ini_set('display_errors', '1'); Commented Jan 19, 2013 at 22:08
  • Or try setting it via .htaccess. Commented Jan 19, 2013 at 22:08
  • i added your line in the File php.ini at the very last end located at /etc/php5/apache2. Is this correct? It still only gives me a 500 error message... Commented Jan 19, 2013 at 22:13

4 Answers 4

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.

answered Jan 19, 2013 at 22:10
3
  • I want to see the error directly in the Browser, not in an error_log. Is that not supported anymore? Commented Jan 19, 2013 at 22:17
  • I haven't tested this, but this link might help. The gist is to ensure that display_errors = On Commented Jan 19, 2013 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! Commented Jan 19, 2013 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.

answered Jan 19, 2013 at 22:25
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.

answered Jan 19, 2013 at 22:34
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/

answered Jan 19, 2013 at 23:37

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.