I'm getting the same behavior. I've put my bash script into /usr/bin, and even if I put the absolute path in the command, it doesn't execute the script. I've used shell_exec, exec, system, and passthru with no luck whatsoever. These functions worked for the example command,"whoami". I'm using Apache 2.0.54, with PHP 5.0.4, on Fedora Core 4 (kernel 2.6.12).
For the functions that can set the return value, the return value of my bash script is always 1. Running the script from the command line works with no problems. I have double checked the permissions of the script, and they're set to 755, which means it's world readable and executable. Also, I changed the owner and group to be apache/apache, just to make sure that wasn't it.
I'm stumped, and I need this functionality desperately.
Edit: I forgot to mention that the command I'm trying to pass takes some parameters. The shell command I'm trying to run is this:
/usr/bin/sendxmpp-wrapper $msg $jid
I'm guessing that the script parameters are what is causing it to fail. I tried the command with just the $jid parameter, and still it didn't work. I need to be able to pass at least that variable to the script, because I determine the recipient of a message in the PHP script that is supposed to call the bash script. If there's another way to pass parameters to system commands, I'm curious on how to do it.
I've also double checked it twice, and safe_mode is set to off. I read on the PHP manual site that that can cause problems.