Jump to content

Turn of Error Display

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
Crane

Crane

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 398 posts
I know you can edit your php.ini and turn of error reporting but is there a way to disable that inside of your script, that resides on a users server?

#2
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
You can use the ini_set ( ) function.

However as noted by php.net

'php.net said:

This is a feature to support your development and should never be used on production systems (e.g. systems connected to the internet).


#3
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
You can use error_reporting to change the levels of errors to show - but also disable all of them.

Example:
// Turn error reporting off
error_reporting(0);


#4
Chan

Chan

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 204 posts

v0id said:

You can use error_reporting to change the levels of errors to show - but also disable all of them.

Example:

// Turn error reporting off

error_reporting(0);


I have used this before - it works. Have you ever noticed that the zero (0) option isn't listed on the function page in php.net?

#5
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts

Chan said:

Have you ever noticed that the zero (0) option isn't listed on the function page in php.net?
Do you mean the list with the constants?
I think its because its not a real "error level", it's just a value to disable all of the error reporting.

#6
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
I think you may even be able to do this using a .htaccess file.