PHP exec are not supported on share hosting accounts: http://support.godaddy.com/groups/web-hosting/forum/topic/is-php-exec-available-or-executable/
exec command not running on linux hosting
-
01-09-2022 - |
Question
The following code is working on localhost xampp windows, but when i put it online godaddy shared linux hosting its not working. exec is working as i tries exec('whoami') and it outputs my account id, but the following exec command is not executing.
is there any changes i need to make it work? please guide.
$cmd = 'php file.php';
if (substr(php_uname(), 0, 7) == "Windows"){
pclose(popen("start /B ". $cmd, "r"));
}
else {
exec($cmd . " > /dev/null &");
}
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow