tags:

views:

41

answers:

2

Hi,

i have a php script which sometimes makes some light errors that are not important, but the script stops executing next lines. i want some ini_set or something to make it executes all the script even if there is warning or errors.

note: i can't fix those errors.

Thanks

+2  A: 

If there are fatal errors, the script will stop no matter what and you can do nothing about it. You see there is nothing like "Resume on error" thing like that is in vb. You can suppress the errors though with @ character.

Sarfraz
Thanks, those currently are just warnings, is the warning stops the script?
axel gold
no warnings don't stop them.
Sarfraz
There must be some other fatal error, you should put this on top of your script:ini_set("display_errors", true);error_reporting(E_ALL);
Sarfraz
+1  A: 

You could try wrapping the "unimportant" code in a try/catch block: http://php.net/manual/en/language.exceptions.php

You probably want to understand why the errors are happening first, though. I'm concerned about the fact that you say the errors aren't important and that you can't fix them.

pib
That won't really catch the E_WARNINGs he's seeing, though.
Frank Farmer