Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error on windows: Cannot connect to #101

andrelopez opened this issue Jul 4, 2017 · 4 comments

Fix error on windows: Cannot connect to #101

andrelopez opened this issue Jul 4, 2017 · 4 comments


Copy link

Hi Sebastian! very nice library!
I was testing this tool on windows and I got the next error:

Exception 'phpbu\App\Exception' with message 'tar failed: tar (child): Cannot connect to C: resolve failed /usr/bin/tar: C:/MAMP/htdocs/.......

I did some research, and I found this:

The reason is that tar interprets colons (:) in file names as meaning it is a file on another machine. You can disable this behavior by using the flag --force-local.

So the solution is add the --force-local on the phpbu\App\Cli\Executable\Tar file at the createProcess function:

     * Process generator
    protected function createProcess()

        $process = new Process();
        $tar     = new Cmd($this->binary);

        foreach ($this->excludes as $path) {
            $tar->addOption('--exclude', $path);

        $tar->addOptionIfNotEmpty('--ignore-failed-read', $this->ignoreFailedRead, false);
        $tar->addOptionIfNotEmpty('--use-compress-program', $this->compressProgram);
        $tar->addOption('-' . (empty($this->compressProgram) ? $this->compression : '') . 'cf');
        $tar->addOption('-C', dirname($this->path), ' ');
        /* Added to work on windows */


        // delete the source data if requested
        if ($this->removeSourceDir) {

        return $process;

Let me know If I can help on anything else,
Keep up the good work!

@andrelopez andrelopez changed the title Fix error on windows Fix error on windows: Cannot connect to Jul 4, 2017
Copy link

Hi, thanks for the great analysis.
I will add the --force-local option asap ;)

@sebastianfeldmann sebastianfeldmann self-assigned this Jul 4, 2017
sebastianfeldmann added a commit that referenced this issue Jul 5, 2017
This is needed to make sure files containing ';' are resolved
Copy link

I just released phpbu 4.0.10 you can now add

<option name="forceLocal" value="true" />

to your tar configuration and the --force-local option will be applied to the tar command.

Hope that helps ;)
Cheers, Sebastian

Copy link

It works like a charm!

Thank you.

Copy link

Thank you for investigating this and making it an easy fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants