New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automated updater doesn't check PHP version #17088
Comments
Hi @waldoj thanks for creating this issue. This should actually already be happening. Do you remember on which version of Matomo you were? |
I'm afraid that I'm not sure. Because Matomo (last I checked) can't be scripted to be part of a deploy process, due to the manual config steps, it's not subject to my normal version-control system. I suspect strongly that I last updated it in the summer, probably around July, so perhaps v3.14 or thereabouts. Should I wind up restoring from a backup, I'll be sure to report back with the exact version. |
Be great to report back if you end up restoring. Any chance you know your exact PHP version? So far https://api.matomo.org/1.0/getLatestVersion/?piwik_version=3.14.1-b2&php_version=5.7.5&release_channel=latest suggests the latest version is a 3.14.1 . Also for Looking at the code the only way this would happen is if Matomo was not able to detect the PHP version at all for some reason. We're using |
Sure thing, I'm using v5.6.40-39. I've verified that both |
FWIW, Matomo also reports the unwieldy version name when trying to load any page, I've just noticed:
The error isn't wrong, but it hints that perhaps the installer isn't extracting the actual version number from that bizarre string that PHP is generating. (Or there's also the distinct possibility that I'm barking up the wrong tree here.) |
Thanks @waldoj just debugged/tested the logic for the update check when the exact PHP version is used that you mentioned and it should have still suggested 3.X. I double checked using the debugger. We're using PHP's internal version_compare method and it seems to be able to handle those sort of strings. So right now I can't really explain how this could possibly happen and we haven't heard of any other case like this so I'm tempted to just leave the issue open for now and we see if it ever happens again. If you otherwise backport, and it suggests to upgrade to Matomo 4 again, then it might be interesting to do a few checks. |
If you can't reproduce it, there's nothing to be done. 🤷 If I can reproduce this, I'm happy to return and document further. |
This issue has been mentioned on Matomo forums. There might be relevant details there: https://forum.matomo.org/t/upgraded-to-unavailable-php-how-to-downgrade/22712/10 |
I just used the automated update script for my Matomo installation. It cheerfully ran the update, and now Matomo doesn't work, because it requires PHP 7 and this server uses PHP 5, for legacy reasons.
Requiring PHP 7 is good and right, but the updater needs to verify that the environment is compatible before upgrading.
The text was updated successfully, but these errors were encountered: