Share » Forums » Developer » Fatal error: Class 'eZFile' not found

Fatal error: Class 'eZFile' not found

Fatal error: Class 'eZFile' not found

Friday 06 June 2008 6:07:30 am - 14 replies

Modified on Friday 06 June 2008 6:47:01 am by Hakim Bouras

Author Message

Piotrek Karaś

Friday 06 June 2008 6:13:46 am

What a coincidence... I was just about to write about this as we're struggling with it right now! Same thing, same impossibility to reproduce, and seems related to one of extensions with an abstract datatype class. This also happens only at one location with Debian-based server, when moved elsewhere it doesn't happen...

One thing. In our case, this eZFile error mentions the very last line of a class that implements the abstract class:

class ClassName extends OurAbstractDatatype {
...
} <---- This line is mentioned in the error message...
?>

Maybe that would be a hint of some sort...

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Hakim Bouras

Friday 06 June 2008 6:44:15 am

In fact I am having this problem since many weeks (and was somehow hoping that this will be "magically" corrected with some of the EZ updates - but unfortunately...)

For two of my extensions, I have also the error on the closing bracket of the declaration of the class. For the other it is a "normal" php line... I indicated in my initial post the content of the line with the error.

I have no idea of how going any further...

Cheers,
Hakim

Hakim Bouras

Monday 09 June 2008 2:38:21 am

After further testing, the problem seems to be related to the server configuration (in this case Debian) which is causing the following strange behaviour: from time to time, the server is catching a STRICT php error as a fatal error. In order to fix the problem, I have updated the code of my extensions in order to get rid of all the STRICT errors and until now, I did not get any more these fatal errors.

About the error on the closing brackets '}', it is about the definition of the class which does not match the parent class. You have to go to each of the methods declarations and update them to match the parent declarations (which are slightly different in v4 - from what they were in v3).

Hope this might help.

Hakim

Piotrek Karaś

Monday 09 June 2008 3:08:55 am

Hello Hakim,

This might be something, because our extension had some strict notices as well. However, it miraculously got better after the weekend... this is weird...

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Hakim Bouras

Monday 09 June 2008 11:48:01 pm

Hi Piotrek,

By any chance, do you know if they were any kind of maintenance on your Debian server (update code or config of PHP, Apache...)?

Hakim

Piotrek Karaś

Tuesday 10 June 2008 3:37:37 am

I'll try to find out, but this might be difficult as we've had the VPS upgraded in the "very" meantime... lots of things might have happened...

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Vidar Langseid

Tuesday 19 August 2008 10:12:00 pm

I also had a "Class 'eZFile' not found in" error a month ago or so.
If I don't remember incorrectly the problem was that I was missing a } in the end of a file in one of my custom extension:

I had code like

<?php
class vtest
{
	function foobar()
	{

	}

// no } at the end here
?>

In the first post in this thread I see you got a "Fatal error: Class declarations may not be nested in". This could indicate that you have the same problem.

Piotrek Karaś

Tuesday 19 August 2008 11:04:06 pm

Vidar,

The question remains: why would this behavior vary in time? ;)
Doesn't actually PHP throw a fatal error in case of the last } missing? Never experimented with that...

Cheers,
Piotrek

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Vidar Langseid

Tuesday 19 August 2008 11:22:37 pm

Hi Piotrek.
Sorry, I don't have all the answers. I just wanted to inform you about my problem and my solution as it sounded related to your problem.
It is weird if it only happens from time-to-time, indeed.

However, I would recommend to everybody which experience this problem to double check that they have no such syntax errors as I mentioned above in their files.

If it only happens from time-to-time, maybe some generated code in some cache file lacks a ending "}" ?

Piotrek Karaś

Tuesday 19 August 2008 11:26:07 pm

If it only happens from time-to-time, maybe some generated code in some cache file lacks a ending "}" ?

Actually, that could be something, never thought of it, thanks! If it ever occurs again (becuase it has stopped...) it'll try to backup and script-analyse the cache.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Ole Morten Halvorsen

Wednesday 17 June 2009 4:13:39 am

Just experienced this myself, and it does seems like a cache file is causing the problem. Clearing the cache will make the problem go away (for a while anyways).

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

Kristoffer Tjærnås

Thursday 27 August 2009 12:05:15 am

Thought I should add that I too experienced this. Last night everything was working fine - this morning I get the "Fatal error: Class 'eZFile' not found" message.
And this was on my development computer which has most caching turned off, and did not upgrade PHP between last night and this morning.

It :did: report a PHP Strict warning though - regarding assigning by reference with new, being deprecated. The line generating the warning:
$n7p =& new n7Portal();

changed all of these occurences and guess what - the Fatal error went away ;)

And for the confusing part - I tried changing one of the assignments back to =&, and it still worked. Even tried to clear cache - still works.

indication of a bug somewhere?

Vidar Langseid

Thursday 27 August 2009 2:03:06 am

I have also experienced class not found messages during the last weeks (with eZPage and eZPageZone). Once the problem occur, I have to restart apache in order to make the problem go away.
I kinda suspect it to be an APC problem but just clearing the APC cache ( using apc_clear_cache() ) doesn't help. Apache has to be restarted

Luc Chase

Saturday 17 October 2009 1:52:16 am

Similar problem. Fairly random but often when opening a content class for editing.


Fatal error: Class 'eZFile' not found in /home/ez_consumer/extension/gmaplocation/datatypes/ezgmaplocation/ezgmaplocationtype.php on line 214
Fatal error: eZ Publish did not finish its request

The execution of eZ Publish was abruptly ended, the debug output is present below.

.......

Strict: PHP 	Oct 17 2009 09:39:24

Declaration of eZGmapLocationType::objectAttributeContent() should be compatible with that of eZDataType::objectAttributeContent() in /home/ez_consumer/extension/gmaplocation/datatypes/ezgmaplocation/ezgmaplocationtype.php on line 214


The Web Application Service Provider

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu