Reputation: 19
I have an executable which i wish to execute using PHP. I am using centOS as my server. I created a PHP file execute.php with following code in it:
<?php
echo shell_exec("/var/www/html/myfolder/a.out");
?>
I have also give executing permission to user apache
Still php is not able to execute my file when i browse to execute.php
EDIT: I am able to execute the file using terminal -> php execute.php
EDIT-2: A little progress. It's giving me permission issue error now.
Any help would be appreciated
Upvotes: 1
Views: 63
Reputation: 41
write like this-
$value = shell_exec('/var/www/html/myfolder/a.out'); echo $value;
and also note this function is disabled when php runs in safe mode.
Upvotes: 0