How to show error in PHP?

Asked By 0 points N/A Posted on -
qa-featured

I am trying to run the exec function in order to fix any issue (if there is) with my IM codes.

However, it doesn't show any error.

As a matter of fact if there are any sorts of error, it won't let me know about it.

Can anyone please let me know how to enable it? 

Laji.php :

Error:

Magick: unable to open image `null.png' :
No such file or directory @ error/bc/OpenBlob/2584  
Magic: unable to open file `null.png' @ error/png.c/ReadPNGImage/3083.    
Magick: missing an image filename `page.png' @ error/convert.c/ConvertImageCnd/2949.

SHARE
Answered By 0 points N/A #151144

How to show error in PHP?

qa-featured

 

Majority of the servers don’t show the PHP errors reports as they are set with this option by default, but for the developers it makes them very difficult to keep track of the errors during the troubleshooting. However this problem has a solution; just insert the following code at the beginning of the PHP code.

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

During the debugging just insert the above code at the top of the each page, or if you are using the wordpress or drupal just insert it at the top of you settings file that brings the errors to display from all pages.

Note: don’t forget to remove it before going to take the site live

Drupal:  /sites/default/settings.php
WordPress:  /wp-config.php

Related Questions