changing from php7.4 to php8, unable to start joomla

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
taksejimo
Joomla! Intern
Joomla! Intern
Posts: 50
Joined: Sun Dec 30, 2012 9:49 am

changing from php7.4 to php8, unable to start joomla

Post by taksejimo » Sun Jul 03, 2022 11:23 am

Changing from php 7.4 to php 8, the site got the error "count(): Argument #1 ($value) must be of type Countable|array, int given" at start up time.
The site works normally with php7.4. Joomla version is 3.10.10.
Please advice me what is wrong , how to fix it.

Thanks in advance, T.Sejimo

gws
Joomla! Champion
Joomla! Champion
Posts: 5932
Joined: Tue Aug 23, 2005 1:56 pm
Location: South coast, UK
Contact:

Re: changing from php7.4 to php8, unable to start joomla

Post by gws » Sun Jul 03, 2022 11:35 am

One of your extensions/templates is not compatible with php 8.

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9711
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: changing from php7.4 to php8, unable to start joomla

Post by AMurray » Sun Jul 03, 2022 10:18 pm

turn on the debug function in joomla, and in your web-host settings. (php.ini file or other method), which will help trace what is causing the problem.

Put PHP back to 7.4 first, make the above change, then swtich to PHP 8 and see what the debug comes back with; it should identify the actual script causing the error.

At the same time, providing the FPA report may help us identify the extension.
Refer the red box top of screen: Forum Post Assistant(FPA): https://forumpostassistant.github.io/docs/
Regards - A Murray
General Support Moderator

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: changing from php7.4 to php8, unable to start joomla

Post by sozzled » Sun Jul 03, 2022 10:55 pm

I agree with @AMurray. PHP 8 flags these "countable" issues as fatal errors (while PHP 7 flags them as warnings) and reverting to PHP 7.4 should allow you to work [relatively] normally. The most likely cause is a third-party extension that's not 100% compatible with PHP 7.2+ and, enabling J! debug mode (setting the error reporting level to "maximum" should identify the source of the problem. When you've discovered the source of the problem, contact the author of the extension to find if there's an update that fixes this "countable" error.


Locked

Return to “General Questions/New to Joomla! 3.x”