C5 8.5.2/php7.3 - cache_lifetime


I am in dire need of help for a mission critical site (live). Front UI shows the site but every time I put any page in edit mode it panics into an error page. I can access the dashboard and view site map and nav to pages but thats it.

** Whoops \ Exception \ ErrorException (E_WARNING) **
Use of undefined constant CACHE_LIFETIME - assumed ‘CACHE_LIFETIME’ (this will throw an Error in a future version of PHP)

I had installed a timeline_slider last week and it didn’t install, so I left it and came back to it a few days later. I then contacted the developer of the addon, to which he said, that the php version I was using was too old. So I logged into my hosting acc and changed from PHP5.6 to 7.3. After than, the Extend Concrete page to install the addon then appeared. So, I then went to install it and all looked OK. Then I went to the page I wanted to add it and got another page panic error. I was really frustrated then and decided to go back to PHP5.6, which then cause the whole site to go into page panic mode. I was frantic, and set it back to PHP7.3 and removed the stupid timelime_slider addon. Now I cannot even edit a single page on my site, but view site and get into the dashboard menus.

I checked the .htaccess file if there were any bad references, but all good.

I have looked in /Application/Blocks, but the folder is blank to see if any configuration.php file was around to rem our the cache_lifetime error.

Please help.

Thank you

I would say, clear you cache in C5, can you do this if not go to application>files and rename the cache folder

Actually i did do that earlier on, but after that the site also
hung with the cache_lifetime error

OK will try this. I am dumping my C5 files as a backup right now and backing up database before I do anything drastic

That error is going to be found in a Block Controller it’ll look like this (most likely)

protected $btCacheBlockOutputLifetime = CACHE_LIFETIME;

If you turn on the full error output you should be able to see which file it is in.

Yes, its looking more like a C5 block, as I have cleared the cache (renamed cache folder) and it is still doing it. I can login to the dashboard and on every single page I try to edit, it hangs on this error state, i.e can’t load the site. How do I turn on full error output?

I found the block_controller.php which had this line in it (protected $btCacheBlockOutputLifetime = CACHE_LIFETIME;`) from my C5 backup dump, now I need to find it on my remote FTP server. :smiley:

When you get to it, you can just remove that line, it’s not needed anymore. Turning the error output on is in Dashboard → System & Settings → Debug Settings

Everything works now. It was a twitter_feed block causing this to happen. All is good and thank you for your help.

Thank you, this was very helpful! I got the same error and found the offending line of code in the audio player, in the controller.php. Deleted the line, and everything works again!! This caused me so much headache, so happy to have found this here