Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How to hide the php error on webbrowser?

user-image
Question ajoutée par Mohammad Irfan , Certified Magento Developer , Xcite.com
Date de publication: 2013/10/25
Muhammad Majid Saleem
par 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
par 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
par 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
par islam khalil , Technical Manager , iCloudit

start you script with

error_reporting(0);

Noor Khan
par Noor Khan , Technical Team Lead , Ammrys Studios

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

Malik Faizan Babar
par 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

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?