There could be a few reasons why the exec() function in PHP is not executing the command as expected.
The exec(), system(), and passthru() functions are all used to execute external programs in PHP.