[GH-ISSUE #46] run commands (mtr, ping , traceroute) not working #32

Open
opened 2026-02-28 00:40:14 +03:00 by kerem · 9 comments
Owner

Originally created by @dkraklan on GitHub (Jan 11, 2018).
Original GitHub issue: https://github.com/telephone/LookingGlass/issues/46

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.

Originally created by @dkraklan on GitHub (Jan 11, 2018). Original GitHub issue: https://github.com/telephone/LookingGlass/issues/46 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.
Author
Owner

@ghost commented on GitHub (Jan 21, 2018):

Refer to:
https://github.com/telephone/LookingGlass/issues/44#issuecomment-333401402

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.

<!-- gh-comment-id:359216015 --> @ghost commented on GitHub (Jan 21, 2018): Refer to: https://github.com/telephone/LookingGlass/issues/44#issuecomment-333401402 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.
Author
Owner

@dkraklan commented on GitHub (Jan 23, 2018):

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

<!-- gh-comment-id:359629165 --> @dkraklan commented on GitHub (Jan 23, 2018): Thank you! Are you able to explain what adding the curly braces does ?
Author
Owner

@andrew867 commented on GitHub (Apr 4, 2018):

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.

<!-- gh-comment-id:378774325 --> @andrew867 commented on GitHub (Apr 4, 2018): [http://php.net/manual/en/migration70.incompatible.php](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.
Author
Owner

@maxigentr commented on GitHub (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']);

<!-- gh-comment-id:532600835 --> @maxigentr commented on GitHub (Sep 18, 2019): > Refer to: > [#44 (comment)](https://github.com/telephone/LookingGlass/issues/44#issuecomment-333401402) > > 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']);`
Author
Owner

@damianharouff commented on GitHub (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.

<!-- gh-comment-id:660323553 --> @damianharouff commented on GitHub (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.
Author
Owner

@kgrahul commented on GitHub (Sep 27, 2021):

I replaced that line but doesnt work

<!-- gh-comment-id:927809809 --> @kgrahul commented on GitHub (Sep 27, 2021): I replaced that line but doesnt work
Author
Owner

@umiseaz commented on GitHub (Aug 29, 2024):

Refer to:
https://github.com/telephone/LookingGlass/issues/44#issuecomment-333401402

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

<!-- gh-comment-id:2317245773 --> @umiseaz commented on GitHub (Aug 29, 2024): > Refer to: > https://github.com/telephone/LookingGlass/issues/44#issuecomment-333401402 > > 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
Author
Owner

@herzadigital commented on GitHub (Jan 19, 2025):

I still have problem with this... I have changed the line44 on ajax.php, but seems still not working...

<!-- gh-comment-id:2600796635 --> @herzadigital commented on GitHub (Jan 19, 2025): I still have problem with this... I have changed the line44 on ajax.php, but seems still not working...
Author
Owner

@jackson01010101 commented on GitHub (Aug 26, 2025):

Refer to:

You have to correct the 44th line as follows.

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

This is the correct one. Thanks a lot.

<!-- gh-comment-id:3222996074 --> @jackson01010101 commented on GitHub (Aug 26, 2025): > Refer to: > > You have to correct the 44th line as follows. > > `$output = $lg->{$_GET['cmd']}($_GET['host']);` This is the correct one. Thanks a lot.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/LookingGlass#32
No description provided.