Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
diff --git a/include/cli_check.php b/include/cli_check.php
index 9342fdca..b4204c28 100644
--- a/include/cli_check.php
+++ b/include/cli_check.php
@@ -23,7 +23,7 @@
*/
/* do NOT run this script through a web browser */
-if (!isset($_SERVER['argv'][0]) || isset($_SERVER['REQUEST_METHOD']) || isset($_SERVER['REMOTE_ADDR'])) {
+if (php_sapi_name != 'cli') {
die('<br><strong>This script is only meant to run at the command line.</strong>');
}
I suspect that for some reason your server is setting $_SERVER['REQUEST_METHOD'] and $_SERVER['REMOTE_ADDR'] at the cli which is weird.
diff --git a/include/cli_check.php b/include/cli_check.php
index 9342fdca..b4204c28 100644
--- a/include/cli_check.php
+++ b/include/cli_check.php
@@ -23,7 +23,7 @@
*/
/* do NOT run this script through a web browser */
-if (!isset($_SERVER['argv'][0]) || isset($_SERVER['REQUEST_METHOD']) || isset($_SERVER['REMOTE_ADDR'])) {
+if (php_sapi_name != 'cli') {
die('<br><strong>This script is only meant to run at the command line.</strong>');
}
I suspect that for some reason your server is setting $_SERVER['REQUEST_METHOD'] and $_SERVER['REMOTE_ADDR'] at the cli which is weird.
Can you tell me the OS and PHP version?
I make changes in /usr/share/cacti/site/include/cli_check.php but it doesn`t help.
os:
Step 97 means begin installation. Eula 1 means you accepted our license terms. It does sound like the installer is not spawning the background exec. I will have to try and get a version of Mint going to see if I can spot the obvious.
I have got exactly the same error (complete replicate on all messages described above) on a completely different system (Synology NAS running Linux Kernel Version 3.10.105 / Synology 6.2 GM-23824).
I tried to update from a fully working cacti v1.1.38 to v1.2.1
This may be related to a CLI issue that has come to light where some people have WEB-based information appearing in their CLI environments of PHP. For example, in another post on here about being unable to update the PHP location, someone sent me their installation logs and then when he applied a temporary code change for debugging purposes we found that $_SERVER['REQUEST_METHOD'] and $_SERVER['REMOTE_ADDR'] where both being set.
That is highly unusual from a CLI point of view because there is no REQUEST_METHOD since it isn't a HTTP request, and the REMOTE_ADDR is not normally set as that is normally the client address. But a CLI doesn't consider itself a client/server environment so again should not be set.
I am about to push some changes to our latest development code to correct the issue. We then need to run through a bunch of tests to ensure that the change is OK. It does seem to be specific environments only though and not a general issue making me think it's a configuration or environmental option that's causing the above weirdness.