3

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

1
  • Why can't you fix those errors? Errors are important in PHP, that's why your program is not completing. Commented Jan 20, 2010 at 4:07

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, those currently are just warnings, is the warning stops the script?
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);
0

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.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.