-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Validate PHP version mismatch #11621
Conversation
$web_version = PHP_VERSION; | ||
$cli_version = rtrim(shell_exec('php -r "echo PHP_VERSION;"')); | ||
if (version_compare($web_version, $cli_version, '!=')) { | ||
$validator->fail("PHP version of your webserver ($web_version) does not match the cli version ($cli_version)", "If you updated PHP recently, restart php-fpm or apache to switch to the new version"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmh ... "restart php-fpm, apache. nginx or what webserver you use.. " ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restarting nginx will never have any affect on the php version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and you can use php-fpm with apache
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To nitpick you can run php other ways than php-fpm in that case, Nginx unit is one way :)
Point is we can't cover all use cases, some things need to be left to the sysadmin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request has been mentioned on LibreNMS Community. There might be relevant details there: https://community.librenms.org/t/v1-64-release-changelog-may-2020/12290/1 |
If the webserver does not match the cli version this means they recently upgraded and have not restarted the service.
This can cause errors with some cached data.
DO NOT DELETE THE UNDERLYING TEXT
Please note
Testers
If you would like to test this pull request then please run:
./scripts/github-apply <pr_id>
, i.e./scripts/github-apply 5926
After you are done testing, you can remove the changes with
./scripts/github-remove
. If there are schema changes, you can ask on discord how to revert.