-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
Unable to update PHP location during installation due to incorrect CLI environment #2311
Comments
During our debugging steps, it was identified that various web-based values were being set by PHP, even though the cli_check.php script was being executed via shell_exec() and therefore was a cli not web script.
On my CLI, the only things set where:
A fix for this is currently being tested and committed to develop, then will be tested across multiple OS environments. |
This commit corrects a previous unseen issue where the PHP environment at command line level is being populated with environment variables normally only seen when called from a web server. issue#2304: Installation progress stays at 0% issue#2311: Unable to update PHP location during installation due to incorrect CLI environment The new check uses the php_sapi_name() function to verify that we are indeed at 'cli' level. All other values returned by php_sapi_name are considered non-cli including 'cli-server' which is for client/server scenarios. Most checks have now been replaced by a single defintion ('CACTI_CLI') to define whether in CLI mode. If a script is only to be called from CLI it must either defined 'CACTI_CLI_ONLY' or include include/cli_check.php instead of include/global.php.
The never ending installation is probably the same issue and was reported in #2304 |
As part of #2315 I have updated the code to provide better detection of invalid scenario's. If possible, could you update to the latest develop code and see if that works for you? |
I switched to the develop branch and the install and upgrade process completed successfully! I can now login to the main application again. I'll hunt around and verify that everything is still working well as far as graphs updating, etc. |
This error showed up in the logs during the upgrade:
|
But that didn't stop the installation? The strange thing is that the step error is 1, which is the welcome screen. |
No, the installation went forward without visible issues. Everything seems to be working well, too. Graphs are updating again just fine. Perhaps the error appeared because the previous upgrade stalled out and was unable to complete? |
Maybe. Not too worried, but I would advise that you set reduce your system logging level if you haven't already done so. Also, run the following to remove the installation debugging as you should hopefully not need it next time:
If you are happy, go ahead and close the issue. |
Sounds good. Thanks again for all your help! |
Forum link: https://forums.cacti.net/viewtopic.php?f=21&t=59445&sid=b9fe62f5b46182adb2c65c7915bf9e5e
Apache version: Apache/2.4.37
PHP version: 5.6.39
MySQL version: 10.1.37-MariaDB
Distro Name: CentOS Linux release 7.6.1810 (Core)
Kernel Version: 3.10.0-957.1.3.el7.x86_64
The install/upgrade wizard fails on step 5 when checking the path of PHP. The issue can be worked around by manually removing the $_SERVER['REQUEST_METHOD'] and $_SERVER['REMOTE_ADDR'] checks within cli_test.php
Also, not sure if related, but when manually correcting the above issue, the final part of the installation loops repeatedly and does not complete. The following errors repeat every few seconds in the cacti.log when debug level is set to 5:
The text was updated successfully, but these errors were encountered: