Joomla fails to load after upgrade to PHP 8 Topic is solved

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
Post Reply
linuxpc4me
Joomla! Intern
Joomla! Intern
Posts: 70
Joined: Thu Nov 10, 2011 12:54 pm

Joomla fails to load after upgrade to PHP 8

Post by linuxpc4me » Fri Feb 10, 2023 4:57 pm

hello all!

I need to move my Joomla 3 site from a php 7.4 server to one that has PHP 8.0 and it fails.
The restoration with Akeeba works fine, no errors and have done so with several moves to different servers with PHP 7.4 (to test steps in export - recovery ).

I built a fresh Ubuntu 22.04 LAMPP server with PHP 8 to experiment with Joomla 4, works fine.

Restored existing website with Akeeba, no errors. Clicked on 'view frount end' and get these errors:

Deprecated: Joomla\Input\Input implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/apptpro/public_html/libraries/vendor/joomla/input/src/Input.php on line 41

Deprecated: Return type of Joomla\Input\Input::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/apptpro/public_html/libraries/vendor/joomla/input/src/Input.php on line 170

Deprecated: Joomla\CMS\Input\Input implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/apptpro/public_html/libraries/src/Input/Input.php on line 31

Deprecated: Return type of Joomla\Registry\Registry::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/apptpro/public_html/libraries/vendor/joomla/registry/src/Registry.php on line 126

Deprecated: Return type of Joomla\Registry\Registry::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/apptpro/public_html/libraries/vendor/joomla/registry/src/Registry.php on line 439

Deprecated: Return type of Joomla\Registry\Registry::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/apptpro/public_html/libraries/vendor/joomla/registry/src/Registry.php on line 453

Deprecated: Return type of Joomla\Registry\Registry::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/apptpro/public_html/libraries/vendor/joomla/registry/src/Registry.php on line 468

Deprecated: Return type of Joomla\Registry\Registry::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/apptpro/public_html/libraries/vendor/joomla/registry/src/Registry.php on line 482

Deprecated: Return type of Joomla\Registry\Registry::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/apptpro/public_html/libraries/vendor/joomla/registry/src/Registry.php on line 288

Deprecated: Return type of Joomla\Registry\Registry::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/apptpro/public_html/libraries/vendor/joomla/registry/src/Registry.php on line 112

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/apptpro/public_html/libraries/src/Application/WebApplication.php on line 1256

Deprecated: Automatic conversion of false to array is deprecated in /var/www/apptpro/public_html/libraries/vendor/joomla/uri/src/UriHelper.php on line 50

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/apptpro/public_html/libraries/src/Application/WebApplication.php on line 1305

Deprecated: Return type of Joomla\CMS\Session\Session::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/apptpro/public_html/libraries/src/Session/Session.php on line 298

Warning: session_name(): Session name cannot be changed after headers have already been sent in /var/www/apptpro/public_html/libraries/joomla/session/handler/native.php on line 128

Deprecated: Joomla\CMS\Input\Cookie implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/apptpro/public_html/libraries/src/Input/Cookie.php on line 0

Warning: session_cache_limiter(): Session cache limiter cannot be changed after headers have already been sent in /var/www/apptpro/public_html/libraries/joomla/session/handler/native.php on line 235
Error: Failed to start application: Failed to start the session because headers have already been sent by "/var/www/apptpro/public_html/libraries/vendor/joomla/input/src/Input.php" at line 41.

Is there a way of fixing this?

SIDE NOTE ---- It was suggested I just install fresh Joomla 4. However, I have over 800 registered users using the site with appointment scheduler and other things. I really do not want to lose this database, but unclear of how to
use my current MySQL Database (mysql Ver 8.0.32-0ubuntu0.22.04.2 for Linux on x86_64 ((Ubuntu)) on a fresh installation.

Sorry for the long post...

frostmakk
Joomla! Explorer
Joomla! Explorer
Posts: 262
Joined: Sun Dec 28, 2014 9:30 am
Location: Stavanger, Norway

Re: Joomla fails to load after upgrade to PHP 8

Post by frostmakk » Fri Feb 10, 2023 8:14 pm

All the deprecation and warning messages listed above comes from Joomla 3.x core when run on PHP 8.1 and higher.
If you use PHP 8.0 they should not appear.
Check if you can make the site run properly on 8.0, and start preparing the migration to J4 from there.

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

Re: Joomla fails to load after upgrade to PHP 8

Post by AMurray » Fri Feb 10, 2023 10:43 pm

I agree with @frostmakk - did you build your server with PHP 8.1, then restore the J3.x site? Your question states you built the Ubuntu site with "PHP 8" but not specifying 8.0...8.1 or whatever.
Regards - A Murray
General Support Moderator

KentC
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Oct 22, 2013 4:27 pm

Re: Joomla fails to load after upgrade to PHP 8

Post by KentC » Sat Mar 25, 2023 12:12 am

frostmakk wrote:
Fri Feb 10, 2023 8:14 pm
All the deprecation and warning messages listed above comes from Joomla 3.x core when run on PHP 8.1 and higher.
If you use PHP 8.0 they should not appear.
Check if you can make the site run properly on 8.0, and start preparing the migration to J4 from there.
frostmakk,
Thank you very much for this excellent advice. I had the same problem trying to upgrade to PHP 8.2 and your suggestion resolved the problem for me. I appreciate it greatly.

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

Re: Joomla fails to load after upgrade to PHP 8

Post by AMurray » Sat Mar 25, 2023 10:20 pm

I don't believe J4 runs on PHP 8.2 yet (certainly some extensions may not) but don't expect 3.10 to do so. J3.10 is no longer in active development and only receives critical security updates.
Regards - A Murray
General Support Moderator


Post Reply

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