Site fails to load under php 8.x

Dark Helmet

Member
Hi folks, I'm currently running XF 2.2.1.2 on php 7.4.33, but figured that php 8 or 8.1 would be stable enough by this point that I could make the switch. However, the instant that I do so and reload my site, I'm greeted with a blank, white page. Reverting to 7.4 corrects the issue. So far as I'm aware XF is firmly compatible with php 8 at this point, what can I do to troubleshoot this? If you need any further particular information, just let me know.
 
XF works fine with 8.0 - we use it for our Cloud subscriptions.

Some are running 8.1 but it has not yet been approved for use with XF.

Ensure any third party add-ons are compatible with 8.x.
 
I seem to run into this issue whenever I switch PHP versions. Rebuilding the master data from the CLI usually fixes it for me (no idea why).

Within the XF root directory, run php cmd.php xf:rebuild-master-data.
 
Download requirements test script and run it on your server.
Just don't choose PHP 8.2.
8.0 is recommended.
Thank you, I did so and everything checked out. I assumed it would, since I've been using XF for years.
XF works fine with 8.0 - we use it for our Cloud subscriptions.

Some are running 8.1 but it has not yet been approved for use with XF.

Ensure any third party add-ons are compatible with 8.x.
I will stick to 8.0 then, thank you. According to documentation, all add-ons are indeed compatible.
I seem to run into this issue whenever I switch PHP versions. Rebuilding the master data from the CLI usually fixes it for me (no idea why).

Within the XF root directory, run php cmd.php xf:rebuild-master-data.
I'm not sure my host loves me enough to give me CL access, but I'll ask pretty-please and try this. Thanks!
 
8.0.x works fine on my sites, but not 8.1.x
I believe the reason is because I am using CloudLinux, or at that was the reason given last year. I'll have to try it again, some time :)
 
I did as much prep work as I could, including cleaning up the database and using just the stock theme. Still got the "White Screen of Death" so I ran the "upgrade/rebuild" script from URL as kindly suggested by @rdn. It appeared to start to run, but quickly threw two errors:

Code:
Fatal error: Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv_substr() in <redacted>/src/vendor/symfony/polyfill-mbstring/Mbstring.php:610 Stack trace: #0 <redacted>/src/vendor/symfony/polyfill-mbstring/bootstrap.php(72): Symfony\Polyfill\Mbstring\Mbstring::mb_substr('Error', 0, 75, 'UTF-8') #1 <redacted>/src/vendor/dokuwiki/utf8/utf8.php(164): mb_substr('Error', 0, 75) #2 <redacted>/src/XF/Error.php(139): utf8_substr('Error', 0, 75) #3 <redacted>/src/XF/App.php(2494): XF\Error->logException(Object(Error), true, '') #4 <redacted>/src/XF.php(202): XF\App->logException(Object(Error), true) #5 [internal function]: XF::handleException(Object(Error)) #6 {main} thrown in <redacted>/src/vendor/symfony/polyfill-mbstring/Mbstring.php on line 610

Fatal error: Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv_substr() in <redacted>/src/vendor/symfony/polyfill-mbstring/Mbstring.php:610 Stack trace: #0 <redacted>/src/vendor/symfony/polyfill-mbstring/bootstrap.php(72): Symfony\Polyfill\Mbstring\Mbstring::mb_substr('ErrorException', 0, 75, 'UTF-8') #1 <redacted>/src/vendor/dokuwiki/utf8/utf8.php(164): mb_substr('ErrorException', 0, 75) #2 <redacted>/src/XF/Error.php(139): utf8_substr('ErrorException', 0, 75) #3 <redacted>/src/XF/App.php(2494): XF\Error->logException(Object(ErrorException), true, '') #4 <redacted>/src/XF.php(242): XF\App->logException(Object(ErrorException), true) #5 [internal function]: XF::handleFatalError() #6 {main} thrown in <redacted>/src/vendor/symfony/polyfill-mbstring/Mbstring.php on line 610

I'm not experienced enough in the code to parse all that, but from what I can see it does reference 'vendors' 'symfony' and 'dokuwiki'. However, I don't have any add-ons from such vendors. Don't know if that's part of the stock XF code, or something else. Any thoughts?
 
Enable iconv in PHP.
That appears to have been the root of the issue. When the host made PHP 8 available, they apparently didn't install several packages, including iconv, GD and cURL. Once iconv was enabled the site would load, and from the control panel diagnostics I could then see that the other two were needed. Site is running noticeably faster now. Thanks, @Brogan!
 
My hosting provider upgraded PHP to 8.1 and I get a blank site now like the OP.

I rolled back to 8.0 hoping that would fix it, but I get same blank page.

I ran the test script and it comes back compatible. What am I missing?

I've been running this site since 2017.


Screenshot 2023-03-10 at 8.59.48 AM.webp
 
Frequently you will get a notification when viewing the site source.
Can you provide a link to your site for others to check?
From what it looks like, you don't have the mySQL PECL installed for PHP.
 
running 2.2.13 and having the same issue running 8.0 as above, I have tried some things mentioned here but cannot resolve it.
 
Back
Top Bottom