PHP 7.3: Use of undefined constant CACHE_LIFETIME...

Permalink
Since upgrading to 8.5.1 I get errors at different places, stating the following:
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)


If I set PHP 7.1 on, it's all working, with PHP 7.3 it fails. I get it when clicking "edit" on the frontend in a normal content page, or also when trying to build the sitemap or re-indexing the sitemap in the automated jobs.

Is that a known bug? Is 8.5.1 not compatible with PHP 7.3 yet?

View Replies: View Best Answer
Kiesel replied on at Permalink Best Answer Reply
Fixed it. Found an old block using this constant, removed it, and everything works now.
haundavid replied on at Permalink Reply
haundavid
I see this is about a year ago. Can you explain the steps you took to find the issues and remove the block? Did you remove a theme block within the theme file, a sitewide block in C5?
Kiesel replied on at Permalink Reply
I think I just did a search trough all the blocks looking for "CACHE_LIFETIME".

You probably also could try on a new page to bind in each block at a time and when this error pops up by one block you know it's the problematic one.

I'm not sure anymore if I just de-installed the blocks in the backend under blocks or just removed the CACHE_LIFETIME entry. Like just delete that line should get the error to disappear.