Jump to content

Site stuck on FileCompiler "cache" + Fatal Error: Class 'ProcessWire' not found


modifiedcontent
 Share

Recommended Posts

I had upgraded my Apache configuration to include PHP7.2 and PHP7.3 for a Laravel-based script on the same server. Somehow it/I messed up a previously fine Processwire site, in a very confusing way.

The site still looks fine, but editing template files has no effect whatsoever. It is stuck on some kind of cached version. I have already disabled PHP7's OPcache, cleared browser caches, etc, with no effect.

The pages now apparently come from PW's assets/cache/FileCompiler folder, even though I never enabled template caching for this site.

I have tried adding "namespace ProcessWire;" to the top of the homepage template file, but then I get this fatal error:

Quote

Fatal Error: Uncaught Error: Class 'ProcessWire' not found in /home/myaccount/public_html/mywebsite/site/templates/process/functions.php:7
Stack trace:
#0 /home/myaccount/public_html/mywebsite/site/templates/inc/head.php(1): include()
#1 /home/myaccount/public_html/mywebsite/site/templates/home.php(11): include('/home/bizpartn/...')
#2 /home/myaccount/public_html/mywebsite/wire/core/TemplateFile.php(287): require('/home/bizpartn/...')
#3 /home/myaccount/public_html/mywebsite/wire/core/Wire.php(380): ProcessWire\TemplateFile->___render()
#4 /home/myaccount/public_html/mywebsite/wire/core/WireHooks.php(733): ProcessWire\Wire->_callMethod('___render', Array)
#5 /home/myaccount/public_html/mywebsite/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array)
#6 /home/myaccount/public_html/mywebsite/wire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array)
#7 /home/myaccount/public_html/mywebsite/wire/core/Wire.php(383): ProcessWire\PageRender->___renderPage(Object(Pr (line 7 of /home/myaccount/public_html/mywebsite/site/templates/process/functions.php)

This error message was shown because: you are logged in as a Superuser. Error has been logged.

My functions.php file pulls data in from another Processwire installation on the same VPS with the following line:

$othersitedata = new ProcessWire('/home/myaccount/public_html/myothersite/site/', 'https://myothersite.com/');

That apparently still works fine; the site still displays data from the other installation, but via the "cached" template that I am now unable to change.

 

I don't know where to start with this mess. Does any of this sound familiar to anyone? Any pointers in the right direction would be much appreciated. 

 

Edit:

Adding "$config->templateCompile = false;" to config.php results in the same fatal error as above. 

Link to comment
Share on other sites

Answering my own question:

I got directory/files ownership/permission screwed up on /site/assets/cache. Or PHP7.3 handles those differently?

/cache and /modules should be writable. I had both on 755, but guess ownership was wrong.

Doing this via ssh fixed it:

chown -R myserveruser site/assets/cache

chown -R myserveruser site/modules

chmod -R a+w site/assets/cache

chmod -R a+w site/modules

 

Are there other folders/files I should double-check?

  • Like 1
Link to comment
Share on other sites

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...