[HELP]server memory

Hi! I have 1 such php:

<?php
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);


if($_GET["okogk!ITK-g8klh"] != "afwergwe4t44tg34tg43g3434g34")
{
  exit;
}
if(!isset($_GET["usercode"]) OR !isset($_GET["game"]) OR !isset($_GET["port"]) OR $_GET["game"] == "ts3")
{
  exit;
}

$server_memory =  exec("ps -aux | grep ".escapeshellcmd($_GET["port"])." | awk '{memory +=$4}; END {print memory }'");
$all_memory = exec("free -m | grep Mem | awk '{memory +=$2}; END {print memory }'");

print round($all_memory * $server_memory / 100) ;
?>

This line does not run: $server_memory = exec(“ps -aux | grep “.escapeshellcmd($_GET[“port”]).” | awk ‘{memory +=$4}; END {print memory }’”);

Help

Thanks.

I would love to help you. How is this related to hestia?

I run this php through hestiacp. Then it doesn’t work. returns zero, and if it is on an apache2 + php server, it works.

And your hestia is running nginx + apache2 + php-fpm?

If you load a PHP file with a hello world does it work?

I am not sure if hestia allows the execution of bash scripts. It should be disabled for obvious reasons.

Hestia doesn’t allow users to listen other users services.

Remove /etc/cron.d/hestia-proc and then reboot.

And your hestia is running nginx + apache2 + php-fpm?
Yes.
If you load a PHP file with a hello world does it work?
yes.
I am not sure if hestia allows the execution of bash scripts. It should be disabled for obvious reasons.
Ok.

Thanks, for working!
Is it possible to work only for admin users? I think it provides security, so I don’t want to rule it out at all.

admin user is threated also a normal user. Unless you run it as root

I mean, this is only called by 1 of my own pages so the customer can see their memory usage. The website that the customer sees runs from under the admin user if that helps.