XF 2.0 XenForo Cache Question

Mike

XenForo developer
Staff member
#4
I would keep a copy of the contents (at least from things like add-ons) just in case, but it should generally be.

(Note that the XF2 download does include a generally empty library directory in it, mostly to avoid it being accidentally removed before upgrading.)
 

BassMan

Well-known member
#5
Ok, thank you, I'll rather leave the whole library folder untouched. I assume there won't be any security issues.
 

Gator

Well-known member
#6
I tried the Memcached, but I got a blank unresponsive page during page load. I double checked and Memcached was enabled in PHP. Any suggestions?
 

Gator

Well-known member
#7
When I use PHP 5.6 Memcached works fine, but when I change to PHP 7.0 or 7.1 it displays a blank page. Any suggestions?
 

Mike

XenForo developer
Staff member
#8
It sounds like you don't have the "memcached" PHP extension installed with your PHP 7 config: http://php.net/manual/en/memcached.installation.php (Specific instructions may vary depending on how PHP is setup.)

We should be logging an exception in this case (though it's possible if it happens before the DB connection is established, it may not be logged).
 

Gator

Well-known member
#10
I contacted and asked them to run it and they said the following:

When we upgrade PHP to 7.1 and turn on PHP errors, it looks like your website isn't compatible with PHP 7.1. Below we have listed the PHP errors that are displaying when upgrading to PHP 7.1.

Fatal error: Uncaught Error: Call to undefined function mysqli_init() in /home/public_html/src/XF/Db/Mysqli/Adapter.php:207 Stack trace: #0 /home/public_html/src/XF/Db/Mysqli/Adapter.php(47): XF\Db\Mysqli\Adapter->makeConnection(Array) #1 /homepublic_html/src/XF/Error.php(157): XF\Db\Mysqli\Adapter->getConnection() #2 /home/public_html/src/XF/App.php(3779): XF\Error->logException(Object(ErrorException), true, '') #3 /home/public_html/src/XF.php(289): XF\App->logException(Object(ErrorException), true) #4 [internal function]: XF::handleException(Object(ErrorException)) #5 {main} thrown in /home/public_html/src/XF/Db/Mysqli/Adapter.php on line 207

Fatal error: Uncaught Error: Call to undefined function mysqli_init() in /home/public_html/src/XF/Db/Mysqli/Adapter.php:207 Stack trace: #0 /home/public_html/src/XF/Db/Mysqli/Adapter.php(47): XF\Db\Mysqli\Adapter->makeConnection(Array) #1 /home/public_html/src/XF/Error.php(157): XF\Db\Mysqli\Adapter->getConnection() #2 /home/public_html/src/XF/App.php(3779): XF\Error->logException(Object(ErrorException), false, '') #3 /home/public_html/src/XF.php(367): XF\App->logException(Object(ErrorException)) #4 [internal function]: XF::handleFatalError() #5 {main} thrown in /home/public_html/src/XF/Db/Mysqli/Adapter.php on line 207

We would recommend consulting with your web developer to further assist with these PHP errors.
 

Brogan

XenForo moderator
Staff member
#11
XF2 is fully compatible with PHP7, many customers are running it.

Which host is that?
You may want to consider a different host if they don't understand that error message or how to resolve it.
 

Gator

Well-known member
#13
They responded back with...

Hello,

I enabled mysqlnd in PHP modules in MySQL and the error related to mysqil_init missing is gone. However, I get this new error.

==
Fatal error: Uncaught ErrorException: [E_WARNING] array_key_exists() expects parameter 2 to be array, boolean given in /home/public_html/src/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php:98 Stack trace: #0 [internal function]: XF::handlePhpError(2, '[E_WARNING] arr...', '/home/...', 98, Array) #1 /home/public_html/src/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php(98): array_key_exists('xf[data_codeEve...', false) #2 /home/public_html/src/XF/DataRegistry.php(113): Doctrine\Common\Cache\CacheProvider->fetchMultiple(Array) #3 /home/public_html/src/XF/DataRegistry.php(81): XF\DataRegistry->readFromCache(Array, Array) #4 /home/public_html/src/XF/DataRegistry.php(215): XF\DataRegistry->get(Array) #5 /home/public_html/src/XF/App.php(2783): XF\DataRegistry->offsetGet('codeEventListen...') #6 /home/public_html/src/XF/Container.php(55): XF\App->XF\{closure}(Object(XF\Container)) #7 /home/public_html/src/XF/App.ph in /home/public_html/src/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php on line 98
==

All PHP settings can be checked at https://www.the-armory.net/info.php and you can pass this page after switching to PHP 7.1 to your developer. If they think anything in PHP is wrong, they can let us know the exact module or variable that needs tweaked and we will be more than happy to tweak it for you.
 

Mike

XenForo developer
Staff member
#14
So at this point, it looks like we've gotten to Memcached, though I'm pretty sure that error is only happening because the Memcached connection itself isn't working. What does your config for it look like in config.php?
 

Gator

Well-known member
#15
Code:
<?php

$config['db']['host'] = 'localhost';
$config['db']['port'] = '3306';
$config['db']['username'] = 'myusername';
$config['db']['password'] = mypassword';
$config['db']['dbname'] = 'mydatabasename';
$config['superAdmins'] = '1,2';
$config['fullUnicode'] = true;
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'Memcached';
$config['cache']['config'] = [
    'server' => '127.0.0.1'
];
 

Mike

XenForo developer
Staff member
#16
Just to confirm, you do have a Memcached server running, bound to 127.0.0.1 and accessible on the (standard) port 11211?
 

Gator

Well-known member
#18
Also, when I set it to PHP 7.1 instead of a blank non-responsive page, I get this error:

Code:
Fatal error: Uncaught Error: Call to undefined function mysqli_init() in /home/public_html/src/XF/Db/Mysqli/Adapter.php:207 Stack trace: #0 /home/public_html/src/XF/Db/Mysqli/Adapter.php(47): XF\Db\Mysqli\Adapter->makeConnection(Array) #1 /home/public_html/src/XF/Error.php(157): XF\Db\Mysqli\Adapter->getConnection() #2 /home/public_html/src/XF/App.php(3779): XF\Error->logException(Object(ErrorException), true, '') #3 /home/public_html/src/XF.php(289): XF\App->logException(Object(ErrorException), true) #4 [internal function]: XF::handleException(Object(ErrorException)) #5 {main} thrown in /home/public_html/src/XF/Db/Mysqli/Adapter.php on line 207

Fatal error: Uncaught Error: Call to undefined function mysqli_init() in /home/public_html/src/XF/Db/Mysqli/Adapter.php:207 Stack trace: #0 /home/public_html/src/XF/Db/Mysqli/Adapter.php(47): XF\Db\Mysqli\Adapter->makeConnection(Array) #1 /home/public_html/src/XF/Error.php(157): XF\Db\Mysqli\Adapter->getConnection() #2 /home/public_html/src/XF/App.php(3779): XF\Error->logException(Object(ErrorException), false, '') #3 /home/public_html/src/XF.php(367): XF\App->logException(Object(ErrorException)) #4 [internal function]: XF::handleFatalError() #5 {main} thrown in /home/public_html/src/XF/Db/Mysqli/Adapter.php on line 207
 

Mike

XenForo developer
Staff member
#19
That's back to error from before and it's caused by the MySQLi extension not being enabled. Your host should be able to guide you how to enable that. It's one of XenForo's requirements, so you may wish to use the requirements test script.

Just to note: if you want to use Memcached, you need to have the extension in PHP and an actual Memcached server running. Running this is like running MySQL -- it's a whole additional daemon that needs to be running on the server. Unless you know this has been explicitly installed and setup and you have a dedicated server/VPS, it's unlikely to be available.
 

Gator

Well-known member
#20
Okay, I enabled the MySQLi extensionn PHP and I get this:
Code:
Fatal error: Uncaught ErrorException: [E_WARNING] array_key_exists() expects parameter 2 to be array, boolean given in /home/thearmor/public_html/src/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php:98 Stack trace: #0 [internal function]: XF::handlePhpError(2, '[E_WARNING] arr...', '/home/thearmor/...', 98, Array) #1 /home/thearmor/public_html/src/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php(98): array_key_exists('xf[data_codeEve...', false) #2 /home/thearmor/public_html/src/XF/DataRegistry.php(113): Doctrine\Common\Cache\CacheProvider->fetchMultiple(Array) #3 /home/thearmor/public_html/src/XF/DataRegistry.php(81): XF\DataRegistry->readFromCache(Array, Array) #4 /home/thearmor/public_html/src/XF/DataRegistry.php(215): XF\DataRegistry->get(Array) #5 /home/thearmor/public_html/src/XF/App.php(2783): XF\DataRegistry->offsetGet('codeEventListen...') #6 /home/thearmor/public_html/src/XF/Container.php(55): XF\App->XF\{closure}(Object(XF\Container)) #7 /home/thearmor/public_html/src/XF/App.ph in /home/thearmor/public_html/src/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php on line 98
Also, Memcached works fine when PHP 5.6 is enabled, so I will just keep it at that. :)

My host prides themselves on hosting your software as seen here: https://www.a2hosting.com/web-hosting/compare Scroll down the page and you will see they mention XenForo Litespeed

Thanks anyway for taking the time to look at my issue. I truly enjoy using XenForo software, and I don't miss IPBoard at all. :cool:
 
Top