2015-11-10 27 views
6

Ben wesite açıklandığı gibi, besteci php aracılığıyla yüklemeye çalışıyorum.Besteci yükleme hatası - çıktı bir tty değil, giriş bir tt değil

php -r "readfile('https://getcomposer.org/installer');" | php 

Ama şu hatayı görüntülüyor: pencerelerde 7

$ php -r "readfile('https://getcomposer.org/installer');" | php 
output is not a tty 
input is not a tty 

Ben ve bu komutu çalıştırmak için git bash kullanarak. Windows komut isteminde, iyi çalışıyor. Bu sorun, yalnızca bu komutu git bash 2.6.2-64bit'den çalıştırdığımda ortaya çıkar.

BTW, Windows için besteci yükledim ve bu iyi çalışıyor. Ancak composer.phar'ı bu şekilde indiremiyorum. Bu sorunu nasıl giderebilirim?

+0

sorun git bash yerine Windows komut satırından komut çalıştırdığınız olmasıdır sanki görünüyor yüklediğiniz bazı-paketi-isterse onu to-gerektirir . Ancak, bahsettiğiniz talimatların bir bağlantısı olmadan, emin olmak zordur. –

+0

evet, Johnston, windows komut isteminden kullandığımda, iyi çalışıyor. Sadece test ettim, ama git bash ile çalışmıyor. Sence git bash sorunu mu? Ama daha önce git bash ile de kullanabilirdim (diğer bilgisayarlarda/diğer git bash versiyonunda). –

cevap

6

bir yol ya da bir kodlama sorun olabilir:

it seems that git ls-remote origin , run from a freshly-built and installed MinGW Git fails to be able to output anything, and git ls-remote origin | cat (a trick learned from working with old MSys'/MinGW's quirks) only says: output is not a tty (the exit code is 127, suggesting that some executable was not found, but it is very difficult to say which one because not even debug print statements to stderr are shown; It seems that in case of a crash or of a die(), stderr is not flushed)

  • issue 519 da unalias önermektedir winpty

    unalias $(alias | grep winpty | cut -d"=" -f1 | cut -d" " -f2) 
    

Ama:

No, we cannot simply abandon winpty. PHP can be run interactively, i.e. it requires a proper Win32 Console. Running PHP without winpty in MinTTY would not provide that Console instance, leaving you with a seemingly unresponsive terminal.

See git-for-windows/[email protected] , #399 and #400 to understand what havoc you would wreak by simply removing those aliases.

Bu yüzden şu anda bash konsolu program Win32 Console için gerektirdiğinde gerekli görünüyor winpty, yarar olmayabilir ikinci | php olarak (borudan php yürütülmesi ile uyumlu değildir etkileşimli kullanım). in the comments üzerinden

Peh puan:

If you use C:`Program Files\Git\bin\bash.exe instead of C:\Program Files\Git\git-bash.exe`, then the command works fine.
I'm using it in combination with ConsoleZ without any problems

bash.exegit-bash.exe aykırı winpty, kullanmadığı için muhtemelen.

+6

Eğer 'C: \ Program Files \ Git \ bin \ bash.exe' yerine 'C: \ Program Files \ Git \ git-bash.exe' komutunu kullanırsanız, komut düzgün çalışır. Ben [ConsoleZ] (https://github.com/cbucher/console) ile herhangi bir sorun olmadan birlikte kullanıyorum. –

+0

@Peh Bu geri bildiriminiz için teşekkür ederiz. Daha fazla görünürlük için cevaba dahil ettim. – VonC

+0

Teşekkürler Vonc ve Peh. –

2

VonC'nin cevabı doğrudur ve gelecekte başkalarına yardımcı olmak için daha görsel bir çözüm sunmak istiyorum. \ Program Files \ Git \ bin

  • Artık bir komut istemi görmelisiniz
  • enter image description here

    • bash.exe çift tıklayın: C gidin

      • .

      • PHP proje dizininize gidin ve Composer'ı yükleyin.

        $ cd C: \ yol \

        $ -sS https://getcomposer.org/installer kıvrılıp sizin \ proje \ olarak | php

        $ ls

      • dosya composer.phar proje kök artık görünür.

      • Besteci ile bir paket yükleyin.

        $ php composer.phar

    +0

    Güzel illüstrasyon. +1 – VonC