D. Evans
D. Evans

Reputation: 3292

Calling git from PHP: Broken pipe error

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:

Does anyone have any idea what might be going on?

Upvotes: 2

Views: 1711

Answers (2)

hegemon
hegemon

Reputation: 6764

Does PHP throw any errors? Maybe max_execution_time is too low? Mu guess PHP app exites prematurely.

Upvotes: 0

VonC
VonC

Reputation: 1324148

It may depend on your exact platform, but findutils has been known to throw that kind of error message before.
On Fedora, that rpm package version 4.2.33-2.fc9 fixed the issue.

Upvotes: 1

Related Questions