# \[Solved\] Nextcloud 23 and Php 8.1.2 breaks cron.php

**URL:** <https://help.nextcloud.com/t/solved-nextcloud-23-and-php-8-1-2-breaks-cron-php/132541>\
**Category:** ℹ️ Support\
**Tags:** nc23, php\
**Created:** [February 2, 2022, 10:07pm UTC](https://help.nextcloud.com/t/solved-nextcloud-23-and-php-8-1-2-breaks-cron-php/132541 "2022-02-02T22:07:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![flotillaropes](https://help.nextcloud.com/letter_avatar/flotillaropes/32/5_5575768a8748004e209b776fc1b2916d.png) [@flotillaropes](https://help.nextcloud.com/u/flotillaropes)\
**Post date:** [February 2, 2022, 10:07pm UTC](https://help.nextcloud.com/t/solved-nextcloud-23-and-php-8-1-2-breaks-cron-php/132541/1 "2022-02-02T22:07:55Z")

</div>

I’m running NC 23 on Rasperry Pi 4. It has been and continues to run great. Today, when I navigated to overview nextcloud runs the Security and setup scan. I noticed a strange message I’ve never seen before.

Last background job execution ran 14 days ago. Something seems wrong.

I checked the log and it’s clean. Nothing to see here.

So, I manually run the cron.php command from the command line with:  
`sudo -u www-data php -f /var/www/nextcloud/cron.php`

and it doesn’t run at all. It outputs this message:

This version of Nextcloud is not compatible with \> PHP 8.0.  
You are currently running 8.1.2.

I regularly run updates on my system and at some point 14 days ago php must have updated and this has completely broken the nextcloud cron.php from running backup jobs.

Interestingly, my nextcloud instance seems to be running fine. It’s just cron.php that is broken so none of my background jobs are being run and it is recommended that they be run every 5 mins.

I don’t know how to fix this. Hoping someone can help.

Thank you!

---

<div class="post-metadata">

**Author:** ![flotillaropes](https://help.nextcloud.com/letter_avatar/flotillaropes/32/5_5575768a8748004e209b776fc1b2916d.png) [@flotillaropes](https://help.nextcloud.com/u/flotillaropes)\
**Post date:** [February 3, 2022, 1:22am UTC](https://help.nextcloud.com/t/solved-nextcloud-23-and-php-8-1-2-breaks-cron-php/132541/2 "2022-02-03T01:22:48Z")

</div>

Solved with the following workaround. Fortunately it’s an easy fix. Change the preferred version of php to the system.

Here’s how I did it:

run `php -v`  
and it will show php 8.1 as the default version.

run  
`sudo update-alternatives --config php`

and select the number corresponding to php 8.0

run `php -v` again to verify and it will show php 8.0 is now default. Restart php services and test.

Now cron.php is working again.

Devs are aware of this per [Support PHP8.1 · Issue #29287 · nextcloud/server · GitHub](https://github.com/nextcloud/server/issues/29287#issuecomment-1014567488)

From devs, "Just downgrade/avoid 8.1, sit down and wait. That’s what we need to do for now - and it works fine 😉

---

<div class="post-metadata">

**Author:** ![khalsajings](https://help.nextcloud.com/letter_avatar/khalsajings/32/5_5575768a8748004e209b776fc1b2916d.png) [@khalsajings](https://help.nextcloud.com/u/khalsajings)\
**Post date:** [March 9, 2022, 5:50pm UTC](https://help.nextcloud.com/t/solved-nextcloud-23-and-php-8-1-2-breaks-cron-php/132541/3 "2022-03-09T17:50:45Z")

</div>

Thank You. Such a simple solution.

---

<div class="post-metadata">

**Author:** ![lordwotton](https://help.nextcloud.com/letter_avatar/lordwotton/32/5_5575768a8748004e209b776fc1b2916d.png) [@lordwotton](https://help.nextcloud.com/u/lordwotton)\
**Post date:** [March 22, 2022, 11:00pm UTC](https://help.nextcloud.com/t/solved-nextcloud-23-and-php-8-1-2-breaks-cron-php/132541/4 "2022-03-22T23:00:52Z")

</div>

thanks a lot, had the same issue and your solution saved my day!

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 13, 2024, 1:47pm UTC](https://help.nextcloud.com/t/solved-nextcloud-23-and-php-8-1-2-breaks-cron-php/132541/5 "2024-12-13T13:47:43Z")

</div>


