Jump to content

Fatal error: Class 'Page' not found


Chuvi
 Share

Recommended Posts

Hi, guys! I'm quite new to ProcessWire, but already have few sites up and running.

Few days ago two of four PW3 websites hosted on the same hosting ground started to throw error 500 stated that 

Fatal error: Class 'Page' not found in /..path_from_root../wire/modules/Fieldtype/FieldtypeRepeater/RepeaterPage.php on line 14 

I've changed nothing in the code/content of those two sites for two weeks, so I think something could change on the hosting ground.

Could I get some advice, how to trace the problem and fix it? Any help would be appreciated.

Link to comment
Share on other sites

Thanks for reply, @arjen, it helped. Quite strange way to fix, non the less.

How do you think, since it just a permission problem, maybe there is a way to fix it without uploading more than thousand files (as I'm behind slow ADSL line in Thailand)? Something like chown some some file/folder(s)?

I met problem like this before, but that was new installation and I just reinstall it... 

Link to comment
Share on other sites

you can just place like a fixperms.php (with the below code) file in the root and load it (then delete it):

<?php

exec ("find /home/user/public_html/ -type d -exec chmod 0755 {} +");
exec ("find /home/user/public_html/ -type f -exec chmod 0644 {} +");

replace the path with the root of which folders you need to fix.

our main host switched like 30 sites to a different machine and the perms were completely messed up after the migration.

  • Like 4
Link to comment
Share on other sites

13 hours ago, Chuvi said:

Thanks for reply, @arjen, it helped. Quite strange way to fix, non the less.

How do you think, since it just a permission problem, maybe there is a way to fix it without uploading more than thousand files (as I'm behind slow ADSL line in Thailand)? Something like chown some some file/folder(s)?

Another option is to tar the files locally and extract them on your server. Tar will respect your permissions. 

  • Like 4
Link to comment
Share on other sites

So, guys, here I come again.

After restoring one site with re-uploading, like @arjen said, I restored second one with shell command, like @Macrura proposed.

First site (restored by re-uploading) was ok, opens and works fine, until I tried to login to admin (went to admin url) to add new template. It throwed this error:

Error: Class 'InputfieldText' not found (line 7 of /...path-to.../wire/modules/Inputfield/InputfieldPassword.module) 

Now the is site down, throwing same error at any page.

Second site, fixed with shell chown command, works smooth.

So I tried to run chown on the first site, but after execution, site refused to display anything (including error message, that should be displayed, as debug mode is on). I got 500 error, blank page, and no logs, not even in /site/assets/logs/error.txt.

After that I tried to fix that by re-uploading that bunch of files like @arjen said. That helps a bit, now error message can be seen, but no more.
Site still throwing the same "Error: Class 'InputfieldText' not found".

I'm stuck again. Any suggestions?

Edited by Chuvi
usernames fix
Link to comment
Share on other sites

Weird stuff you are experiencing. Something is interfering with your permissions (I assume the file InputfieldPassword.module is there?). Have you contacted your hosting provider?

 

Link to comment
Share on other sites

Yeah, weird. You think it's just permission problem?

I reuploaded /wire/*, index.php, .htaccess once again, and nothing changed. InputfieldPassword.module throws error on line 7, so I suppose it's there.

No, I didn't contacted support as I can't see what I should ask them. They don't provide "debugging" support. ) I have few more installations of PW on the same hosting account, and they are ok, have no problems at all. So it's just a one particular problem, that I don't know how to trace or fix without building it once again from scratch...

Update: Fixed by deleting failing modules, after deleting InputfieldPassword.module, PW throwed same error again, but in jQueryFancybox.module, which I deleted in the next step. Now site is up and running again.

Edited by Chuvi
Added how I fixed it.
Link to comment
Share on other sites

Not sure. I only experienced this once during an internal hosting migration. If the files are there and PHP can't seem to load the classes, it seems to me there must be something with permissions/ownership of those files.

Glad you got it working. These things are notoriously time-consuming to debug.

 

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...