php hide ALL errors

前端 未结 5 2191
自闭症患者
自闭症患者 2020-12-01 03:57

what are the best practises for hiding all php errors? As I don\'t want ERRORS to show to the user.

I\'ve tried using the .htacess by p

5条回答
  •  [愿得一人]
    2020-12-01 03:59

    Per the PHP documentation, put this at the top of your php scripts:

    
    

    http://php.net/manual/en/function.error-reporting.php

    If you do hide your errors, which you should in a live environment, make sure that you are logging any errors somewhere. How to log errors and warnings into a file? Otherwise, things will go wrong and you will have no idea why.

提交回复
热议问题