Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to hide the php error on webbrowser?

user-image
Question added by Mohammad Irfan , Certified Magento Developer , Xcite.com
Date Posted: 2013/10/25
Muhammad Majid Saleem
by Muhammad Majid Saleem , Senior PHP Developer / Project Manager , SwaamTech

You can hide them using error_reporting(0); at the top of the page.

Fadi Alkhateeb
by Fadi Alkhateeb , Senior Front End Developer , NexTwo

You have two options:

  1. If you have access and permisson to edit php.ini, search for (display_errors) inside it and put value (off): display_errors = Off
  2. Using (error_reporting(0);) at the top of the page.

[?php error_reporting(0); ?]

 

Atif Majid
by Atif Majid , Senior PHP Programer/Team Lead , RedApple Apartments AB

If it is production server and you have access to php.ini file, then it is best to turn off display_errors.

Else you can do it from your script as

ini_set("display_errors", "Off");

 

Or you can use .htaccess to override the values for your web directory (if you are on a shared hosting server)

simply write error_reporting(0); at start of page inside php tag

islam khalil
by islam khalil , Technical Manager , iCloudit

start you script with

error_reporting(0);

Noor Khan
by Noor Khan , Technical Team Leader , Insightz360

which type of error you need to hide, cuz there are to many type of errors 

Malik Faizan Babar
by Malik Faizan Babar , IT Project Manager , VOIP Terminator

include this function on top of the page or include in header file  <?php error_reporting(0); ?>

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.