Rajasekar Gunasekaran
Rajasekar Gunasekaran

Reputation: 1827

PHP does not return a warning or notice on syntax error

When I run some php code with a syntax error, it does not show any warning or fatal error. Instead, it shows the message below

Server error The website encountered an error while retrieving http://190.168.191.32/administrator/reports.php. It may be down for maintenance or configured incorrectly. Here are some suggestions: Reload this web page later.

What is the reason and how do I solve this problem?

Upvotes: 0

Views: 320

Answers (3)

Paté
Paté

Reputation: 1964

The error you are describing is a 500 Error.

PHP is setup to throw this when the error reporting is not public(production env).

If you want to see them from the browser you'll have to set

display_errors = On in you php.ini

Upvotes: 1

yankee
yankee

Reputation: 40750

check your php.ini file. Especially check the options display_errors and error_reporting

Or/And read the log file of your Webserver. On a typcial setup with apache on linux this is /var/log/apache/error.log

Upvotes: 0

Florian
Florian

Reputation: 3171

In debug environments, use error_reporting(E_ALL | E_STRICT) so that php reports all errors.

Upvotes: 1

Related Questions