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

Failed to clone http://github.com/fabpot/Twig.git, git was not found, check that it is installed and in your PATH env. #613

Closed
dcb opened this issue Apr 23, 2012 · 59 comments

Comments

@dcb
Copy link

commented Apr 23, 2012

I'm getting the error in the subject on an Ubuntu 10.4 machine. git is working fine and it is in the path. I even updated to git 1.7.10 using the launchpad package, but the problem persisted. I also tried different packages in the composer.json file, still the error persisted. I am using php 5.4.0, compiled from sources.

POSSIBLE SOLUTION: If you have ansicon installed on windows try to remove it, see https://bugs.php.net/bug.php?id=63567 and comments for more details.

@Seldaek

This comment has been minimized.

Copy link
Member

commented Apr 23, 2012

Could you try to run this on the CLI and paste the output here?

php -r 'var_dump(exec("git --version", $out, $ret), $out, $ret);'
@dcb

This comment has been minimized.

Copy link
Author

commented Apr 23, 2012

Sure, here it is:

string(18) "git version 1.7.10"
array(1) {
  [0]=>
  string(18) "git version 1.7.10"
}
int(0)
@Seldaek

This comment has been minimized.

Copy link
Member

commented Apr 23, 2012

Ok that is weird, so it seems to work like that, but not via the Process component we use to make the git calls.

Did you get any more output than what you put in the issue title?

@dcb

This comment has been minimized.

Copy link
Author

commented Apr 23, 2012

Here is the full output with -v

Installing dependencies
Installing twig/twig (1.7.x-dev)
  - Package twig/twig (dev-master)
    Cloning f79a56b431a3e6afa66ac8799ee7e25838059328
Cloning into '/export/www/fotounivers/vendor/twig/twig'...
HEAD is now at f79a56b fixed compatibility with PHP 5.2 and simplify code a bit
Cloning into '/export/www/fotounivers/vendor/twig/twig'...
HEAD is now at f79a56b fixed compatibility with PHP 5.2 and simplify code a bit
Cloning into '/export/www/fotounivers/vendor/twig/twig'...
HEAD is now at f79a56b fixed compatibility with PHP 5.2 and simplify code a bit



  [RuntimeException]                                                                                                      
  Failed to clone http://github.com/fabpot/Twig.git, git was not found, check that it is installed and in your PATH env.  





Exception trace:
 () at phar:///export/www/fotounivers/composer.phar/src/Composer/Downloader/GitDownloader.php:122
 Composer\Downloader\GitDownloader->throwException() at phar:///export/www/fotounivers/composer.phar/src/Composer/Downloader/GitDownloader.php:100
 Composer\Downloader\GitDownloader->runCommand() at phar:///export/www/fotounivers/composer.phar/src/Composer/Downloader/GitDownloader.php:36
 Composer\Downloader\GitDownloader->doDownload() at phar:///export/www/fotounivers/composer.phar/src/Composer/Downloader/VcsDownloader.php:55
 Composer\Downloader\VcsDownloader->download() at phar:///export/www/fotounivers/composer.phar/src/Composer/Downloader/DownloadManager.php:142
 Composer\Downloader\DownloadManager->download() at phar:///export/www/fotounivers/composer.phar/src/Composer/Installer/LibraryInstaller.php:86
 Composer\Installer\LibraryInstaller->install() at phar:///export/www/fotounivers/composer.phar/src/Composer/Installer/InstallationManager.php:136
 Composer\Installer\InstallationManager->install() at phar:///export/www/fotounivers/composer.phar/src/Composer/Installer/InstallationManager.php:119
 Composer\Installer\InstallationManager->execute() at phar:///export/www/fotounivers/composer.phar/src/Composer/Installer.php:353
 Composer\Installer->doInstall() at phar:///export/www/fotounivers/composer.phar/src/Composer/Installer.php:146
 Composer\Installer->run() at phar:///export/www/fotounivers/composer.phar/src/Composer/Command/InstallCommand.php:62
 Composer\Command\InstallCommand->execute() at phar:///export/www/fotounivers/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:237
 Symfony\Component\Console\Command\Command->run() at phar:///export/www/fotounivers/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:193
 Symfony\Component\Console\Application->doRun() at phar:///export/www/fotounivers/composer.phar/src/Composer/Console/Application.php:70
 Composer\Console\Application->doRun() at phar:///export/www/fotounivers/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:106
 Symfony\Component\Console\Application->run() at phar:///export/www/fotounivers/composer.phar/src/Composer/Console/Application.php:59
 Composer\Console\Application->run() at phar:///export/www/fotounivers/composer.phar/bin/composer:9
 require() at /export/www/fotounivers/composer.phar:15


install [--prefer-source] [--dry-run] [--dev]
@Seldaek

This comment has been minimized.

Copy link
Member

commented Apr 23, 2012

It seems like it returns a non-zero status code even when it works somehow. Because the 3 clones you see seem to have worked, yet it retries and eventually fails. Then it probes for git --version to see if git is installed and it fails again.

Could you do a clone of https://github.com/symfony/Process and run the test suite? Just wondering if it's a general issue on your setup or if it's something we did.

@dcb dcb closed this Apr 23, 2012
@dcb

This comment has been minimized.

Copy link
Author

commented Apr 23, 2012

Quite a few failures. I'll get that sorted out. Thanks!

@Seldaek

This comment has been minimized.

Copy link
Member

commented Apr 23, 2012

Ok, feel free to report it on https://github.com/symfony/symfony if you find any specific issue with the Process component. And if the issue is in your setup, please report back here so we can hopefully add it to the detection in the install script and help other people avoid the issue.

@romain-dartigues

This comment has been minimized.

Copy link

commented Aug 13, 2012

Good day,

I'm running into the very same problem with no workaround at (near-)sight... how did you sort that out?

Thanks.

@EpaL

This comment has been minimized.

Copy link

commented Aug 14, 2012

Does anyone know of a fix for this? I've been going mad the last few days trying to get composer to work but it just refuses to.

I just ran a composer.phar selfupdate and it installed the latest and greatest but I'm still having exactly the same issue as described above:

~> composer.phar update -v                          
Updating dependencies
Installing pimple/pimple (dev-master db836b)
  - Installing pimple/pimple (dev-master)
    Cloning db836b8cfadc0f39dacafa2bf311a1ab603600bb
Cloning into '/apps/apache/htdocs/dbios-welcome/vendor/pimple/pimple'...
Cloning into '/apps/apache/htdocs/dbios-welcome/vendor/pimple/pimple'...
Cloning into '/apps/apache/htdocs/dbios-welcome/vendor/pimple/pimple'...



  [RuntimeException]                                                                                                        
  Failed to clone http://github.com/fabpot/Pimple.git, git was not found, check that it is installed and in your PATH env.  





Exception trace:
 () at phar:///apps/apache/bin/composer.phar/src/Composer/Downloader/GitDownloader.php:223
 Composer\Downloader\GitDownloader->throwException() at phar:///apps/apache/bin/composer.phar/src/Composer/Downloader/GitDownloader.php:170
 Composer\Downloader\GitDownloader->runCommand() at phar:///apps/apache/bin/composer.phar/src/Composer/Downloader/GitDownloader.php:37
 Composer\Downloader\GitDownloader->doDownload() at phar:///apps/apache/bin/composer.phar/src/Composer/Downloader/VcsDownloader.php:55
 Composer\Downloader\VcsDownloader->download() at phar:///apps/apache/bin/composer.phar/src/Composer/Downloader/DownloadManager.php:150
 Composer\Downloader\DownloadManager->download() at phar:///apps/apache/bin/composer.phar/src/Composer/Installer/LibraryInstaller.php:151
 Composer\Installer\LibraryInstaller->installCode() at phar:///apps/apache/bin/composer.phar/src/Composer/Installer/LibraryInstaller.php:85
 Composer\Installer\LibraryInstaller->install() at phar:///apps/apache/bin/composer.phar/src/Composer/Installer/InstallationManager.php:132
 Composer\Installer\InstallationManager->install() at phar:///apps/apache/bin/composer.phar/src/Composer/Installer/InstallationManager.php:119
 Composer\Installer\InstallationManager->execute() at phar:///apps/apache/bin/composer.phar/src/Composer/Installer.php:472
 Composer\Installer->doInstall() at phar:///apps/apache/bin/composer.phar/src/Composer/Installer.php:178
 Composer\Installer->run() at phar:///apps/apache/bin/composer.phar/src/Composer/Command/UpdateCommand.php:75
 Composer\Command\UpdateCommand->execute() at phar:///apps/apache/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:239
 Symfony\Component\Console\Command\Command->run() at phar:///apps/apache/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:193
 Symfony\Component\Console\Application->doRun() at phar:///apps/apache/bin/composer.phar/src/Composer/Console/Application.php:86
 Composer\Console\Application->doRun() at phar:///apps/apache/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:106
 Symfony\Component\Console\Application->run() at phar:///apps/apache/bin/composer.phar/src/Composer/Console/Application.php:66
 Composer\Console\Application->run() at phar:///apps/apache/bin/composer.phar/bin/composer:13
 require() at /apps/apache/bin/composer.phar:15


update [--prefer-source] [--dry-run] [--dev] [--no-custom-installers] [--no-scripts] [packages1] ... [packagesN]

Please help!

Thank you.

@justin-johnn

This comment has been minimized.

Copy link

commented Aug 17, 2012

I have exactly same problem on php composer.phar update

[RuntimeException]                                                                              
  Failed to clone http://github.com/fabpot/Twig.git via git, https and http protocols, aborting.  

  - git://github.com/fabpot/Twig.git                                                              
    fatal: No such remote 'composer'                                                              

  - https://github.com/fabpot/Twig.git                                                            
    fatal: No such remote 'composer'                                                              

  - http://github.com/fabpot/Twig.git                                                             
    fatal: No such remote 'composer' 

How to correct it?

@Seldaek

This comment has been minimized.

Copy link
Member

commented Aug 17, 2012

@justinamt that looks like you have an outdated vendor dir (from a very old composer.phar) just delete the vendor/* and run install or update again to get them up to date.

@Seldaek

This comment has been minimized.

Copy link
Member

commented Aug 17, 2012

@romain-dartigues @EpaL: I'm not sure what to tell you. Most likely if it says it can't find git it's because it's not in your PATH env var. Unless you give more details I'm afraid I can't help you.

@justin-johnn

This comment has been minimized.

Copy link

commented Aug 18, 2012

@Seldaek Thanks a lot. It works fine now.
I have doubt, may be not related to here. I have created a vendor bundle(MyBundle) and it is dependent to two other bundles. Is there any possibility to give only MyBundle in composer and it needs to install other two bundle to vendors dir with any alteration inside MyBundle?

@Seldaek

This comment has been minimized.

Copy link
Member

commented Aug 18, 2012

@justinamt if you put the two bundles in your bundle's "require" section of composer.json, they will be installed when you install yours. I'm not sure whether that answers your question, but either way if you have other issues please open a new ticket because indeed it's not related to this one.

@Seldaek

This comment has been minimized.

Copy link
Member

commented Aug 26, 2012

@EpaL @johmue I figured out the issue thanks to @romain-dartigues providing a machine with the problem. It comes from --enable-sigchild. If you recompile php without that it works fine. I got a workaround sent to symfony, but not sure yet if it'll be merged: symfony/symfony#5353

@Seldaek Seldaek reopened this Aug 26, 2012
@Seldaek

This comment has been minimized.

Copy link
Member

commented Sep 7, 2012

This should now be fixed btw, closing the issue until further notice.

@Seldaek Seldaek closed this Sep 7, 2012
@orochies

This comment has been minimized.

Copy link

commented Sep 28, 2012

I also I have the same problem, solved anything?

@Seldaek

This comment has been minimized.

Copy link
Member

commented Sep 29, 2012

@orochies can you give more details about your setup and what error you're seeing?

@orochies

This comment has been minimized.

Copy link

commented Oct 2, 2012

StofDoctrineExtensionsBundle installing I get the following output:

symfony 2.1.2 installed

C:\wamp\www>git --version
git version 1.7.11.msysgit.1

And add GIT to PATH en Windows 7 Ultimate in:

C:\Program Files\Git\cmd;C:\wamp\bin\php\php5.4.3

C:\wamp\www\symfony>php composer.phar update
Loading composer repositories with package information
Updating dependencies

  • Removing doctrine/common (2.3.0)

  • Installing doctrine/common (2.3.x-dev bb0aebb)
    Cloning bb0aebbf234db52df476a2b473d434745b34221c

    [RuntimeException]

    Failed to clone http://github.com/doctrine/common, git was not found, check that it is installed and in your PATH env.

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-custom-installers] [--no-scripts] [-v|--verbose] [pac
kages1] ... [packagesN]

Thanks.

@johmue

This comment has been minimized.

Copy link

commented Oct 9, 2012

Hi,

the problem is still present for me (Win7 with msysgit) - tested 5 minutes ago.

First I updatet composer to get the latest version then I checked if git works and afterwards I tried to install symfony.

See my log of the cmd for more detail (for the english of you "Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch." means "the filename,directory name, or volume label syntax is incorrect" which is probably related to the path "C:\Program Files (x86)\Git" which includes special characters).

C:\UniServer\udrive\www>php composer.phar self-update
You are using the latest composer version.

C:\UniServer\udrive\www>php -r "var_dump(exec('git --version', $out, $ret), $out
, $ret);"
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung
ist falsch.
string(28) "git version 1.7.11.msysgit.1"
array(1) {
  [0]=>
  string(28) "git version 1.7.11.msysgit.1"
}
int(1)

C:\UniServer\udrive\www>php composer.phar create-project -v symfony/framework-st
andard-edition MySf2Project/ 2.1.2
Installing symfony/framework-standard-edition (v2.1.2)
  - Installing symfony/framework-standard-edition (v2.1.2)
    Downloading: 100%
    Unpacking archive
    Cleaning up
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung
ist falsch.

Created project in MySf2Project/
Loading composer repositories with package information
Installing dependencies from lock file
  - Installing twig/twig (dev-master b4d1d62)
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung
ist falsch.
    Cloning b4d1d62b82e83c6fd3d5a6cd46a186de64275bb4
Cloning into 'C:\UniServer\udrive\www\MySf2Project\vendor/twig/twig'...
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung
ist falsch.
Cloning into 'C:\UniServer\udrive\www\MySf2Project\vendor/twig/twig'...
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung
ist falsch.
Cloning into 'C:\UniServer\udrive\www\MySf2Project\vendor/twig/twig'...
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung
ist falsch.
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung
ist falsch.




  [RuntimeException]

  Failed to clone http://github.com/fabpot/Twig.git, git was not found, check th
at it is installed and in your PATH env.


  Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnun
g ist falsch.






Exception trace:
 () at phar://C:/UniServer/udrive/www/composer.phar/src/Composer/Downloader/GitD
ownloader.php:224
 Composer\Downloader\GitDownloader->throwException() at phar://C:/UniServer/udri
ve/www/composer.phar/src/Composer/Downloader/GitDownloader.php:171
 Composer\Downloader\GitDownloader->runCommand() at phar://C:/UniServer/udrive/w
ww/composer.phar/src/Composer/Downloader/GitDownloader.php:37
 Composer\Downloader\GitDownloader->doDownload() at phar://C:/UniServer/udrive/w
ww/composer.phar/src/Composer/Downloader/VcsDownloader.php:59
 Composer\Downloader\VcsDownloader->download() at phar://C:/UniServer/udrive/www
/composer.phar/src/Composer/Downloader/DownloadManager.php:161
 Composer\Downloader\DownloadManager->download() at phar://C:/UniServer/udrive/w
ww/composer.phar/src/Composer/Installer/LibraryInstaller.php:151
 Composer\Installer\LibraryInstaller->installCode() at phar://C:/UniServer/udriv
e/www/composer.phar/src/Composer/Installer/LibraryInstaller.php:85
 Composer\Installer\LibraryInstaller->install() at phar://C:/UniServer/udrive/ww
w/composer.phar/src/Composer/Installer/InstallationManager.php:132
 Composer\Installer\InstallationManager->install() at phar://C:/UniServer/udrive
/www/composer.phar/src/Composer/Installer/InstallationManager.php:119
 Composer\Installer\InstallationManager->execute() at phar://C:/UniServer/udrive
/www/composer.phar/src/Composer/Installer.php:491
 Composer\Installer->doInstall() at phar://C:/UniServer/udrive/www/composer.phar
/src/Composer/Installer.php:184
 Composer\Installer->run() at phar://C:/UniServer/udrive/www/composer.phar/src/C
omposer/Command/CreateProjectCommand.php:185
 Composer\Command\CreateProjectCommand->installProject() at phar://C:/UniServer/
udrive/www/composer.phar/src/Composer/Command/CreateProjectCommand.php:88
 Composer\Command\CreateProjectCommand->execute() at phar://C:/UniServer/udrive/
www/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Comma
nd.php:239
 Symfony\Component\Console\Command\Command->run() at phar://C:/UniServer/udrive/
www/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.p
hp:193
 Symfony\Component\Console\Application->doRun() at phar://C:/UniServer/udrive/ww
w/composer.phar/src/Composer/Console/Application.php:99
 Composer\Console\Application->doRun() at phar://C:/UniServer/udrive/www/compose
r.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:106
 Symfony\Component\Console\Application->run() at phar://C:/UniServer/udrive/www/
composer.phar/src/Composer/Console/Application.php:72
 Composer\Console\Application->run() at phar://C:/UniServer/udrive/www/composer.
phar/bin/composer:37
 require() at C:\UniServer\udrive\www\composer.phar:15


create-project [--prefer-source] [--repository-url="..."] [--dev] [--no-custom-i
nstallers] [--no-scripts] package [directory] [version]

Hope this helps to improve composer.

Thanks
Johannes

btw. do you have a page online how to build the phar archive from source?

$phar = new Phar('myComposer.phar');
$phar->buildFromDirectory(__DIR__ . '/Composer');
$phar->setStub($phar->createDefaultStub('bin/composer'));

didn't make it for me - i tried to debug with source...

@stof

This comment has been minimized.

Copy link
Contributor

commented Oct 9, 2012

Building the phar is done by running the bin/compile script.

@johmue

This comment has been minimized.

Copy link

commented Oct 9, 2012

Thanks Christophe.

I had to comment out line 39 - 41 in Compiler.php to get it run, but looks fine now.

// if ($process->run() != 0) {
//     throw new \RuntimeException('Can\'t run git log. You must ensure to run compile from composer git repository clone and that git binary is available.');
// }
@Seldaek

This comment has been minimized.

Copy link
Member

commented Oct 9, 2012

@johmue you actually don't need to compile the phar btw, I run mine via bin/composer from sources directly.

Anyway regarding your problem it is weird that the var_dump you did shows that git --version seems to work and output the right stuff, yet it returns a non-zero exit code, and prints this weird error.. I wonder what happens if you try to run this instead:

php -r "var_dump(exec(escapeshellarg('C:\Program Files (x86)\Git\bin\git.exe').' --version', $out, $ret), $out, $ret);"

Because I think git sets the PATH to C:/program files/Git/cmd by default, which will use git.cmd and that does more stuff and maybe fails somehow?

@johmue

This comment has been minimized.

Copy link

commented Oct 9, 2012

It works fine. :)

C:\UniServer\udrive\www>php -r "var_dump(exec(escapeshellarg('C:\Program Files (
x86)\Git\bin\git.exe').' --version', $out, $ret), $out, $ret);"
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung
ist falsch.
string(28) "git version 1.7.11.msysgit.1"
array(1) {
  [0]=>
  string(28) "git version 1.7.11.msysgit.1"
}
int(1)

Weird!

@Seldaek

This comment has been minimized.

Copy link
Member

commented Oct 9, 2012

So same problem calling git.exe directly.. what the hell is going on?

@johmue

This comment has been minimized.

Copy link

commented Oct 9, 2012

The funny thing is...

C:\UniServer\udrive\www>git --version
git version 1.7.11.msysgit.1

C:\UniServer\udrive\www>php -r "var_dump(exec(escapeshellarg('C:\Program Files (
x86)\Git\bin\git.exe').' --version', $out, $ret), $out, $ret);"
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung
ist falsch.
string(28) "git version 1.7.11.msysgit.1"
array(1) {
  [0]=>
  string(28) "git version 1.7.11.msysgit.1"
}
int(1)
@orochies

This comment has been minimized.

Copy link

commented Oct 10, 2012

Has Installed GIT Version Git-1.7.11-preview20120710.exe

then add the routes; C:\Program Files\Git\cmd;C:\Program Files\Git\bin to the environment variables and my problem is resolved.

Thank you.

@titomiguelcosta

This comment has been minimized.

Copy link

commented Oct 17, 2012

happened to me a few minutes ago the exact same thing @jastin-amt reported two months ago, after deleting the vendor folder and run a composer update, problem gone.

@llops

This comment has been minimized.

Copy link

commented Oct 19, 2012

@titomiguelcosta Same problem, same solution! (and a lot of hours lost...)
Thanks to all.

@TroodoNmike

This comment has been minimized.

Copy link

commented Nov 1, 2012

removing vendor directory solved the problem

@maximise

This comment has been minimized.

Copy link

commented Nov 8, 2012

I seem to have the same problem with installing symfony. I've been fighting with this for more than a week, and am running out of good ideas.

I don't normally use a command line so I might be doing something obvious wrong, though I've tried just about everything I could come up with, including everything in this thread. Basically everything short of a complete OS reinstall :-)

Pointers or hints in the right direction, loose ideas, and just about anything else would be greatly appreciated.

thanks a lot for the help, and thanks for smfony2!

Here's a CLI output:

C:\Users\max\Dropbox\development\code\htdocs>php composer.phar create-project symfony/framework-standard-edition C:\Users\max\Dropbox\development\code\htdocs\Symfony 2.1.3 -v
Installing symfony/framework-standard-edition (v2.1.3)

  • Installing symfony/framework-standard-edition (v2.1.3)
    Downloading: 100%
    Unpacking archive
    Cleaning up

Created project in C:\Users\max\Dropbox\development\code\htdocs\Symfony
Loading composer repositories with package information
Installing dependencies from lock file

  • Installing twig/twig (dev-master 0505c2f)
    Cloning 0505c2fefd5eaa81c628b0cf8a9b8a2bc612321c
    Cloning into 'C:\Users\max\Dropbox\development\code\htdocs\Symfony\vendor/twig/twig'...
    Cloning into 'C:\Users\max\Dropbox\development\code\htdocs\Symfony\vendor/twig/twig'...
    Cloning into 'C:\Users\max\Dropbox\development\code\htdocs\Symfony\vendor/twig/twig'...

    [RuntimeException]
    Failed to clone http://github.com/fabpot/Twig.git, git was not found, check
    that it is installed and in your PATH env.

Exception trace:
() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/src/Composer/Downloader/GitDownloader.php:330
Composer\Downloader\GitDownloader->throwException() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/src/Composer/Downloader/GitDownloader.php:283
Composer\Downloader\GitDownloader->runCommand() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/src/Composer/Downloader/GitDownloader.php:40
Composer\Downloader\GitDownloader->doDownload() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/src/Composer/Downloader/VcsDownloader.php:59
Composer\Downloader\VcsDownloader->download() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/src/Composer/Downloader/DownloadManager.php:161
Composer\Downloader\DownloadManager->download() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/src/Composer/Installer/LibraryInstaller.php:152
Composer\Installer\LibraryInstaller->installCode() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/src/Composer/Installer/LibraryInstaller.php:86
Composer\Installer\LibraryInstaller->install() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/src/Composer/Installer/InstallationManager.php:132
Composer\Installer\InstallationManager->install() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/src/Composer/Installer/InstallationManager.php:119
Composer\Installer\InstallationManager->execute() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/src/Composer/Installer.php:515
Composer\Installer->doInstall() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/src/Composer/Installer.php:186
Composer\Installer->run() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/src/Composer/Command/CreateProjectCommand.php:195
Composer\Command\CreateProjectCommand->installProject() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/src/Composer/Command/CreateProjectCommand.php:94
Composer\Command\CreateProjectCommand->execute() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:238
Symfony\Component\Console\Command\Command->run() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:193
Symfony\Component\Console\Application->doRun() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/src/Composer/Console/Application.php:97
Composer\Console\Application->doRun() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:106
Symfony\Component\Console\Application->run() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/src/Composer/Console/Application.php:70
Composer\Console\Application->run() at phar://C:/Users/max/Dropbox/development/code/htdocs/composer.phar/bin/composer:37
require() at C:\Users\max\Dropbox\development\code\htdocs\composer.phar:15

create-project [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev
] [--no-custom-installers] [--no-scripts] [--keep-vcs] package [directory] [vers
ion]

@stof

This comment has been minimized.

Copy link
Contributor

commented Nov 8, 2012

@maximise do you have git in your path ? Try to run git --version from a cmd prompt.

And take care that msysgit has a bug when cygwin is registered in your path currently (it has been fixed for the next release already)

@Seldaek

This comment has been minimized.

Copy link
Member

commented Nov 8, 2012

@maximise another thing you could try is once you got that error, type:

cd Symfony
php ..\composer.phar install

Just wondering if it would work when you run it directly or if it's an issue with using create-project.

Anyway as a workaround, using the --prefer-dist flag should help since it avoids the use of git.

@johmue

This comment has been minimized.

Copy link

commented Nov 20, 2012

Hi there,

I found a solution for me - but it is very disgusting and a deal breaker for you.

I tweaked Composer/Util/ProcessExecutor.php and vendor/Symfony/Component/Process/Process.php to ignore the given status of the command line process which in my case always returned 1 instead of 0.

After my "patch" - the git process did not break and i could install Symfony with composer without almost no problem. (I also had to tweak the sensio distribution-bundle which brings it's own composer ScriptHandler.php in which it evaluates the process return code on it's own. But after that it worked.)

Hard for me was to get composer work from github because it depends on it's own library which did not work for me. I had to install it with --prefer-dist and afterwards to tweak Compiler.php because it also includes a process status code check for git to be installed.

Cheers
Johannes

@Seldaek

This comment has been minimized.

Copy link
Member

commented Nov 20, 2012

@johmue have you tried updating git to latest? Who knows ;)

@johmue

This comment has been minimized.

Copy link

commented Nov 20, 2012

@Seldaek jepp - I tried everything. I played with my system path variable in every thinkable way i played with my php-cli.ini. I uninstalled git and installed it again... nothing worked for me. Always got the wrong return code and this weird message that the syntax of the file name is wrong.

@Seldaek

This comment has been minimized.

Copy link
Member

commented Nov 20, 2012

@johmue could you maybe open a new issue with a summary of everything you tried, the output above with the wrong error code, maybe a link to your patch, etc. I'd like to have something open to keep it in mind and maybe figure out a solution one day. Could you also try something like this, see if it's just git or php's exec that is messed up?

php -r "var_dump(exec('echo test', $out, $ret), $out, $ret);"
@johmue

This comment has been minimized.

Copy link

commented Nov 20, 2012

@Seldaek i checked the code above and return code is still int(1). So it seems to be related to php.

I will open an issue here even though I think it is more related to the Process component of Symfony. If it is not handled there it will always pop up somewhere.

@Seldaek

This comment has been minimized.

Copy link
Member

commented Nov 20, 2012

You get int(1) with the 'echo test'? Because then php process handling is broken in yet another way I guess. Anyway feel free to report an issue, and also one on symfony/symfony because indeed it'd be great to figure out a generic fix.

What php do you have? From where? Can you run phpinfo() or php -i and copy the value of Configure Command =>?

@johmue

This comment has been minimized.

Copy link

commented Nov 20, 2012

@Seldaek I use PHP 5.4.8 VC9 x86 Thread Safe on a Win7 machine. It's loaded from the official php website for windows http://windows.php.net .

Here you can find the Configue Command line - hope it helps:

Configure Command => cscript /nologo configure.js  "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=C:\php-sdk\oracle\instantclient11\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--disable-static-analyze" "--with-pgo"
@Seldaek

This comment has been minimized.

Copy link
Member

commented Nov 20, 2012

@johmue ok. It does not really help considering I use exactly the same build (on win7 x64) and never had this issue.

@Seldaek

This comment has been minimized.

Copy link
Member

commented Nov 20, 2012

At this point, an ini setting is all I can think of, except for an internal php bug that manifests itself depending on some obscure environmental factor. If you want to mail me your php.ini I can try here.. who knows.

@johmue

This comment has been minimized.

Copy link

commented Nov 20, 2012

@Seldaek I downloaded a fresh copy of php and ran the code against it - still return code int(1).

It's amazing. I also tried fresh copies of PHP 5.5 alpha, 5.3.18 and 5.2.17 and no change so far. I bet it's something with my command line. Maybe another program hooked on it.

@Seldaek

This comment has been minimized.

Copy link
Member

commented Nov 20, 2012

@johmue (continuing the stabbing in the dark..) and what about dir && echo %errorlevel%? and git --version && echo %errorlevel%? Do you get a 0 or 1 on those?

@Seldaek

This comment has been minimized.

Copy link
Member

commented Nov 20, 2012

Sorry cmd acts up a bit weird, do dir then echo %errorlevel% afterwards. Combining with && yields strange results.

@johmue

This comment has been minimized.

Copy link

commented Nov 20, 2012

@Seldaek done! Anything of interest?

C:\>php -r "var_dump(exec('dir', $out, $ret), $out, $ret);"
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung
ist falsch.
string(60) "              30 Verzeichnis(se), 181.199.241.216 Bytes frei"
array(42) {
  [0]=>
  string(36) " Datenträger in Laufwerk C: ist ACER"
  [1]=>
  string(30) " Volumeseriennummer: XXXX-XXXX"
  [2]=>
  string(0) ""
  [3]=>
  string(32) " Verzeichnis von C:\"
  [4]=>
  string(0) ""
  [5]=>
  string(37) "20.11.2012  10:25    <DIR>          ."
  [...skipped...]
}
int(1)

C:\>php -r "var_dump(exec('echo %errorlevel%', $out, $ret), $out, $ret);"
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung
ist falsch.
string(1) "0"
array(1) {
  [0]=>
  string(1) "0"
}
int(1)
@Seldaek

This comment has been minimized.

Copy link
Member

commented Nov 20, 2012

Oh sorry I meant actually type just dir or git --version and then echo %errorlevel% in the shell directly. Just to see if it's already broken at the shell level or if it's php corrupting the exit codes.

@johmue

This comment has been minimized.

Copy link

commented Nov 20, 2012

@Seldaek if that's all - no problem

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung
ist falsch.

C:\>git --version
git version 1.8.0.msysgit.0

C:\>php -r "var_dump(exec('echo %errorlevel%', $out, $ret), $out, $ret);"
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung
ist falsch.
string(1) "0"
array(1) {
  [0]=>
  string(1) "0"
}
int(1)

C:\>
@Seldaek

This comment has been minimized.

Copy link
Member

commented Nov 20, 2012

You still ran echo %errorlevel% via php there :) This is what I mean:

C:\>dir
[... blah ...]

C:\>echo %errorlevel%
0

C:\>git --version
git version 1.7.10.msysgit.1

C:\>echo %errorlevel%
0

If you get zeros, report the bug in php. If you get 1 or anything non-zero.. Then call microsoft :/

@johmue

This comment has been minimized.

Copy link

commented Nov 20, 2012

@Seldaek same output as yours

C:\>dir
[...strip...]

C:\>echo %errorlevel%
0

C:\>git --version
git version 1.8.0.msysgit.0

C:\>echo %errorlevel%
0
@Seldaek

This comment has been minimized.

Copy link
Member

commented Nov 20, 2012

OK so it's php for some reason. I reported it at https://bugs.php.net/bug.php?id=63567

@johmue

This comment has been minimized.

Copy link

commented Nov 20, 2012

Thanks.

@davidwindell

This comment has been minimized.

Copy link

commented Feb 1, 2013

For reference - Uninstalling ansicon as mentioned in the PHP bug report fixed this for me

@halaxa

This comment has been minimized.

Copy link

commented Jul 11, 2013

@davidwindell Thank you so much, removing ansicon solved my problem. Too bad this answer is at the end.

@lukaszjankowski

This comment has been minimized.

Copy link

commented Dec 17, 2013

Removing ansicon also solved my problem.

@JASONMUKAMA

This comment has been minimized.

Copy link

commented Sep 20, 2018

here is my test
string(4) "test"
array(1) {
[0]=>
string(4) "test"
}
int(0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.