When I execute my command in PHP with shell_exec it always returns an empty string. I tried shell_exec(\'ls -l\'); and it works. I put the command as
shell_exec
shell_exec(\'ls -l\');
Most of the time php scripts are run by Apache, if thats the case with your script then Apache user may not have enough permissions to run this command. Check that first. If its run as CLI script then check if PHP user can run the script.