I want to execute a PHP code from VS.code on Debian OS. I'm sure the Apache is installed and active. I'm sure the PHP is installed. I'm sure about the php.executepath is correct.
when I navigate to locallhost/ping.php the web page is loading but when I want to enter the IP and ping it there isn't any result on the page!
this is my code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ping</title>
</head>
<body>
<?php
if(isset($_GET['ip']))
{
$ip = trim($_GET['ipp']);
$cmd = "ping {$ip} -c 2";
print '<pre>'.shell_exec(($cmd)).'<pre>';
}
?>
<form>
IP : <input type="text" name="ip">
<input type="submit" value="Ping">
</form>
</body>
</html>