Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php doesnt show error [closed]

im working in php on suse11.0 my problem is when i type a wrong syntax or query it doesnt show error only blank page shown at this situtaion

thanks

like image 592
webkul Avatar asked Dec 06 '25 17:12

webkul


2 Answers

You might to configure error_reporting (see also), and enable the displaying of errors (see display_errors or ini_set) -- at least on your development machine

In your php.ini file, you'd use

error_reporting = E_ALL | E_STRICT
display_errors = On
html_errors = On

Or, in your PHP code :

error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 'On');

You might also want to install Xdebug on your development box, to get nice stacktraces wehn an error / exception occurs


Of course, on your production machine, you probably don't want to display errors ; so that will have to be configured depending on your environment ;-)

like image 101
Pascal MARTIN Avatar answered Dec 08 '25 08:12

Pascal MARTIN


It is almost certainly the case that display_errors is disabled in php.ini.

This is a good thing on product servers, and makes development systems basically unusable.

For a development system you probably want to add one of these lines to you php.ini file:

error_reporting  =  E_ALL & ~E_NOTICE

or

error_reporting  =  E_ALL
like image 29
acrosman Avatar answered Dec 08 '25 08:12

acrosman