user6107367
user6107367

Reputation:

How to display 500 error in browser while developing OpenCart

I have just faced with problem, I made a mistake in php file and got 500 error.

The error was

[Tue Nov 08 18:07:14.165444 2016] [:error] [pid 1941] [client 192.168.0.1:53549] PHP Parse error:  syntax error, unexpected ',' in /var/www/store/catalog/controller/feed/rest_api.php on line 44

In /var/log/apache2/error.log

So my question if it is possible to display such errors in browser instead of just logging into error file ?

Thanks.

Upvotes: 1

Views: 1069

Answers (2)

Patrick
Patrick

Reputation: 213

This usually works for me:

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

Upvotes: 1

Jirka Hrazdil
Jirka Hrazdil

Reputation: 4021

You can use ini_set('display_errors', '1');, provided that using ini_set is not disabled by PHP configuration.

Upvotes: 0

Related Questions