Skip to content
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

run commands (mtr, ping , traceroute) not working #46

Open
dkraklan opened this issue Jan 11, 2018 · 7 comments
Open

run commands (mtr, ping , traceroute) not working #46

dkraklan opened this issue Jan 11, 2018 · 7 comments

Comments

@dkraklan
Copy link

hello,

I've installed LookingGlass and installation went smooth, however when ever I input an IP and click run test it says loading for a half a second then goes back to run test and never provides any results.

I found an old issue suggesting to change to php 5.4 which i did. I've also tried php 7. I'm not sure what I'm missing any help would be greatly appreciated.

@ghost
Copy link

ghost commented Jan 21, 2018

Refer to:
#44 (comment)

Edit ajax.php and replace:

$output = $lg->$_GET['cmd']($_GET['host']);

with

$output = $lg->{$_GET['cmd']}$_GET['host']);

This works on all new PHP builds for me.

@dkraklan
Copy link
Author

Thank you! Are you able to explain what adding the curly braces does ?

@andrew867
Copy link

http://php.net/manual/en/migration70.incompatible.php

Changes to the handling of indirect variables, properties, and methods
Indirect access to variables, properties, and methods will now be evaluated strictly in left-to-right order, as opposed to the previous mix of special cases.

@maxigentr
Copy link

maxigentr commented Sep 18, 2019

Refer to:
#44 (comment)

Edit ajax.php and replace:

$output = $lg->$_GET['cmd']($_GET['host']);

with

$output = $lg->{$_GET['cmd']}$_GET['host']);

This works on all new PHP builds for me.

You have to correct the 44th line as follows.

$output = $lg->{$_GET['cmd']}($_GET['host']);

@damianharouff
Copy link

damianharouff commented Jul 17, 2020

Putting this here for my future self, and likely for other people: if mtr returns an empty box, but ping, traceroute, etc work, it's likely because mtr is suid:

root@lg:/var/www/html# chsh -s /bin/bash www-data
root@lg:/var/www/html# su www-data
www-data@lg:/html$ mtr
mtr: mtr should not run suid: No such file or directory
www-data@lg:/html$

chmod u-s /usr/sbin/mtr fixed it.

@kgrahul
Copy link

kgrahul commented Sep 27, 2021

I replaced that line but doesnt work

@umiseaz
Copy link

umiseaz commented Aug 29, 2024

Refer to:
#44 (comment)

Edit ajax.php and replace:

$output = $lg->$_GET['cmd']($_GET['host']);

with

$output = $lg->{$_GET['cmd']}$_GET['host']);

This works on all new PHP builds for me.

Working on Ubuntu 20.04 and php7.4.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants