PHP does not display error messages

Wikitechy | 1238 Views | php | 13 Jun 2016

 

Scenario:

When I try to execute the PHP script with mysql_connect() without parameters, PHP will not complain about the required fields.Why is this?

How can I configure PHP to display errors?

Fix1:

Here is the fix to resolve this issue by “Turn on errors” at the script level and include the top of our php script.

ini_set('display_errors', 1);
error_reporting(~0);

Are else if the site is not a production site & simply a development / testing site, means just turn on error reporting in php.ini. search it inside the setting.

error_reporting  =  E_ALL
;error_reporting  =  E_ERROR
display_errors = On
;display_errors = Off

Fix2:

Add the following statement in the .htaccess file.

php_value display_errors on

Applies to:

  • PHP 3 and 4
  • PHP 5
  • PHP 6 and Unicode
  • PHP 7

Related Tags:

  • PHP does not display error messages
  • PHP: error_reporting
  • PHP: Show Errors and Error Handling
  • PHP is not showing any error messages 
  • PHP error_reporting () Function
  • PHP Error Handling
  • php display_errors
  • php error_reporting
  • php error_reporting
  • php display_errors
  • php.ini error reporting
  • php.ini error_reporting




Workshop

Bug Bounty
IOT Hackathon
Webinar

Join our Community

Advertise