I have PHP 5.2.1, and my try/catch blocks have all stopped working.
You can check out all of my configuration settings at http://www.finallyfitness.net/info.php (Yahoo truncates the address, but it's still a functioning link-- it shows the result of calling phpinfo() on my server).
The following code generates the following error message:
******
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);
try
{
if (1 == 1)
throw new Exception("Ick!");
}
catch(Exception $e)
{
echo $e->getMessage();
exit();
}
?>
*****
Fatal error: Uncaught exception 'Exception' with message 'Ick!' in /home/ goddess/ public_html/ except.php:9 Stack trace: #0 {main} thrown in /home/ goddess/ public_html/ except.php on line 9
Why in the world wouldn't this code work? If it's a problem with my server rather than my code, do you have any idea what the problem might be (so I can get the tech guys at my server to fix it)?
Any insight would be appreciated!
2007-03-07
10:16:36
·
3 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design
To csanon:
None of the answers I've received have helped me fix my problem. Yes, I have read what the manual has to say about try/catch blocks, and I've come to the decision that the problem is with my server, not my code.
However, if people with more experience than myself can point out my problem so I can have the tech people at my server fix it, it would help me greatly-- I'm working on a school project, and this issue has stalled my progress completely.
If you don't want to answer my question, feel free to ignore my posts, but it's very unkind to be so snobby about it. Every post I've made has had some new information that I though might help some solve my problem.
:o(
2007-03-07
10:26:34 ·
update #1