I have the following PHP script:
#!/usr/bin/php
<?php
echo shell_exec(
"/usr/bin/git clone --bare ".
"/home/dave/create_project/template_project ".
"/home/dave/create_project/my_test_project.git"
);
About 7 in 10 times that I run it, git gives the following error:
find: write error: Broken pipe
This error never occurs if I run the equivalent command directly from the shell.
I have already tried:
- using other PHP execution functions:
exec
,system
,popen
; - passing the whole command as an argument to bash, i.e.,
exec('bash -c '.$cmd);
Does anyone have any idea what might be going on?