Portal Home > Knowledgebase > Articles Database > PHP Error


PHP Error




Posted by dthbah2006, 01-24-2013, 09:17 AM
Hi, I am getting the following error when entering a username or email that has not registered on my site in the password recovery page. Fatal error: Class 'ClientError' not found in /home/MYSITE/public_html/classes/User.php on line 1089 Here it the code in question: } if (!$user) { // TRANS: Information on password recovery form if no known username or e-mail address was specified. throw new ClientError(_('No user with that email address or username.')); return; } Is there an error in this code? How can I correct this issue? Thank you.

Posted by NetworkPanda, 01-24-2013, 09:49 AM
You are trying to run a class which is not defined. Usually classes are defined by including some external PHP files. So it appears that you forgot to add some include() or require() code in your script. You need to check the instructions provided by the script author and verify that you did not forget some required includes.

Posted by zoid, 01-24-2013, 10:46 AM
The ClientError cannot be found. As NetworkPanda already mentioned it needs to be accessible from the file.

Posted by valley, 01-25-2013, 07:55 AM
It looks like you haven't included the files which has the class ClientError.

Posted by josephgarbett, 01-28-2013, 03:44 AM
Class ClientError extends Exception { } Will solve it

Posted by zoid, 01-28-2013, 05:20 AM
Commenting the line will solve it too but you should refer to the existing class rather than introducing a new one

Posted by Mayvena, 01-28-2013, 03:42 PM
Commenting the line will simply be an ugly workaround - yes, he won't be getting the error, but the class won't be working either. As it was mentioned earlier, he needs to define the class, or if defined in another file - include the file.

Posted by zoid, 01-28-2013, 03:47 PM
Defining the class will also be an ugly workaround. He only need to reference the existing class properly - but NetworkPanda and I already wrote that four days ago.

Posted by Mayvena, 01-28-2013, 03:54 PM
Sorry, I didn't notice you were one of the guys above Anyway, however ugly, defining the class will at least keep things running.

Posted by zoid, 01-28-2013, 04:00 PM
Until you try to access a class member which is defined in the actual class .....

Posted by Mayvena, 01-28-2013, 04:21 PM
You're right of course After all, it it solved the problem in its entirety it would be a fix, and not a workaround

Posted by creativeartist, 01-31-2013, 12:31 PM
Can I see the source code ?

Posted by dlucian, 02-01-2013, 08:46 AM
I'll go with Class ClientError extends Exception { } as well, just like zoid said.

Posted by zoid, 02-01-2013, 02:10 PM
I didnt say so



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
/dev/sda3 full 100% (Views: 664)
MySql Question (Views: 602)

Language: