i'm trying to get the value of my vg space disk. When i run the command in my shell i don't have any problem that returns the correct value, but when i include it in a PHP file i have a return of a NULL value.
I have see a lot of threads discuting about it but none of the answers solved my problem :(
What commands works ? This one :
$variable = shell_exec("df -h | grep "username" | awk '{print $3}'");
I don't think it's a permission problem cause this commands works.. For the test script has 777 and root permission.
The code who has the problem :
$test = "VG Size";
$tailletotaleduserveur = shell_exec("vgdisplay vghome | grep ".$test." | awk '{print $3}'");
echo json_encode($tailletotaleduserveur);
The actual result in network tab : null -> http://prntscr.com/nehsmb
It should return "5.85"
Thanks for help :)
df -h? Is there line with literalusername?