Fixed One-click upgrade failure

Wildcat Media

Well-known member
Affected version
2.1.0 beta 2
I just ran the upgrade from the one-click upgrade on the home page of the admin control panel, to take us from 2.1.0 beta 1 to beta 2. Here's the error:

The following requirements were not met for this upgrade: PHP extension gd is required. PHP extension iconv is required. PHP extension ctype is required. PHP extension pcre is required. PHP extension curl is required.

We are running PHP 5.6.3, and all of those are enabled. (They all appear as enabled in phpinfo(). ) And, the upgrade from 2.0 to 2.1.0 beta 1 went smoothly (aside from the JSON issue) without throwing any errors.

I have a feeling this is some minor "version check" issue.
 
Would you mind submitting a ticket with login details for your Admin CP so we can take a closer look? Perhaps FTP/cPanel (or similar too).

I am away from my desk at the moment so can’t look at the code right now but having access directly will help if I can’t see an obvious problem.
 
Ok, if you give this a try now, it should work. We've implemented a workaround, though it will not work in some theoretical future cases.

So, I think it's something you might want to get looked at in further detail. The specific issue is that code such as phpversion('iconv') is returning false on your server, rather than the expected version. This isn't significant right now, and we've adjusted the code to use a different function, but ideally that function should work as expected.

But, for now, things should be working ok for you.
 
Thank you for reporting this issue. The issue is now resolved and we are aiming to include that in a future XF release (2.1.0 Beta 3).

Change log:
Use extension_loaded to check whether extensions are enabled, rather than relying on phpversion which may return false unexpectedly.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Ok, if you give this a try now, it should work. We've implemented a workaround, though it will not work in some theoretical future cases.

So, I think it's something you might want to get looked at in further detail. The specific issue is that code such as phpversion('iconv') is returning false on your server, rather than the expected version. This isn't significant right now, and we've adjusted the code to use a different function, but ideally that function should work as expected.

But, for now, things should be working ok for you.
Thanks for checking into this, @Chris D, and getting it working. I am going to let the host know about the error so they can figure out why it is happening.

Is there something different between the one-click upgrade vs. doing it manually or via CLI? Or something you introduced in Beta 2? The error didn't come up yesterday when I ran the "big" upgrade. Not a big deal, but just curious.
 
It's specific to one-click upgrades and XF itself so you wouldn't have hit it yesterday as that was a manual upgrade.
 
BTW your host might be interested in testing out the following PHP script:
PHP:
<?php
echo '<pre>';
$e = get_loaded_extensions();
foreach($e as $ext_name)
{
    $v = phpversion($ext_name);
    if ($v) echo $ext_name . " version: ". $v;
    else echo $ext_name . " version: Not available";
    echo '<br />';
}
echo '</pre>';
It's nothing too fancy. It just loops through the loaded extensions and echos out its name and the version if it can find it.

Most of the time you'd expect an output like this:
Code:
Core version: 7.2.9
ctype version: 7.2.9
iconv version: 7.2.9
json version: 1.6.0
pcre version: 7.2.9
curl version: 7.2.9
gd version: 7.2.9
mysqli version: 7.2.9

On your server it comes out like this:
Code:
Core version: 5.6.31
ctype version: Not available
iconv version: Not available
json version: 1.2.1
pcre version: Not available
curl version: Not available
gd version: Not available
mysqli version: 0.1

At the same time, you might want to consider updating to a newer PHP version. That might inherently fix the problem, plus it will improve performance plus you're now on the bare minimum PHP version so an upgrade is going to be essential at some point in the future :)
 
I can get the host to upgrade to php 7.2 most likely, so I agree, it's probably time to do something about it.

For what it's worth, I just tried to run the upgrade and it went back to the same error message. :D Do you want me to leave it as-is so you can take a look at it, or just run through it manually?

188641
 
Back
Top Bottom