Shell_exec not working with git commit
Posted: Fri Mar 05, 2010 3:00 pm
Hello,
I am trying to execute a git commit command through php's shell_exec function, but it just doesn't do anything: nothing is output, the apache error log does not record an error, and if i paste the exact command in the cli then git does commit to the repository. I know this is not a privilege or permissions error since the repository belongs to the web server, and the file permissions are set to 777 (not that it matters). In addition, I am able to run the git checkout and git add commands, but only git commit fails (yet).
My code:
//stage files and then do the following
$command = "git commit -m 'I have modified a file'
shell_exec($command);
header('location: index.php');
If anyone has any ideas, type away!
PS: I believe this is an error pertinent to php, not git, hence my post in this section. I apologise if this ends up being more relevant to git.
Thank you,
Jawad.
I am trying to execute a git commit command through php's shell_exec function, but it just doesn't do anything: nothing is output, the apache error log does not record an error, and if i paste the exact command in the cli then git does commit to the repository. I know this is not a privilege or permissions error since the repository belongs to the web server, and the file permissions are set to 777 (not that it matters). In addition, I am able to run the git checkout and git add commands, but only git commit fails (yet).
My code:
//stage files and then do the following
$command = "git commit -m 'I have modified a file'
shell_exec($command);
header('location: index.php');
If anyone has any ideas, type away!
PS: I believe this is an error pertinent to php, not git, hence my post in this section. I apologise if this ends up being more relevant to git.
Thank you,
Jawad.