Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Bug]: herd php:install ignores the version argument and asks which version to install

Aperta Adatta ai principianti
#1,771 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
83/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
php
Ambito
cli

Direzione di ricerca

Inizia individuando il comando php:install e confrontando il suo argomento della versione con l’argomento phpVersion del comando php:update, come descritto nell’issue. Controlla la guida del comando e riproduci il problema con herd php:install 8.4 per confermare che l’argomento viene ignorato. Il lavoro è terminato quando il comando installa la versione richiesta senza chiedere conferma; verifica il comportamento interattivo e non interattivo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

macOS
Platform

macOS

Operating system version

macOS 27.0.1 (26A434)

System architecture

ARM64 (M1, M2, etc)

Herd Version

2.0.2 (Build: 71)

PHP Version

Not version-specific (global PHP here: 8.5.10)

Bug description

herd php:install 8.4 ignores the 8.4: instead of installing PHP 8.4 it asks "Which PHP version do you want to install?". That is the usage shown in the docs (herd php:install 8.3), in herd list and in herd php:install --help (php:install [<version>]).

In a terminal you can pick the version from the list. Without one (CI, an AI agent, input from a pipe) the command fails with exit code 1 and tells you to "Pass the value as an argument or option instead", although it was passed (log below).

Expected: herd php:install 8.4 installs PHP 8.4 without asking.

Cause, read in herd.phar 2.0.2: Silly's Application::command() merges $input->getOptions() after $input->getArguments(), so Symfony Console's global --version option (false when not given) overwrites the argument that is also named version. php:install is the only Herd command with an argument of that name; php:update [phpVersion] and isolate [phpVersion] are not affected.

Suggestion: rename the argument to phpVersion, as php:update does.

Workaround: install the version in Settings → PHP, or pick it from the list in a terminal.

Steps to reproduce
  1. Herd 2.0.2 with a PHP version that is not installed (here 8.4).
  2. In a terminal, run herd php:install 8.4: it asks which version to install instead of installing 8.4. Press Ctrl-C (nothing is installed).
  3. Without a terminal: herd php:install 8.4 < /dev/null fails with exit code 1.
Relevant log output
$ herd php:install 8.4

 ┌ Which PHP version do you want to install? ───────────────────┐
 │ › ● 8.6                                                    ┃ │
 │   ○ 8.4                                                    │ │
 │   ○ 8.3                                                    │ │
 │   ○ 8.2                                                    │ │
 │   ○ 8.1                                                    │ │
 └──────────────────────────────────────────────────────────────┘
  ⚠ Cancelled.
# (Ctrl-C pressed at the question)

$ herd php:install 8.4 < /dev/null; echo "exit=$?"

In app.php line 92:

  "herd php:install" asked a question but no terminal is attached to answer i
  t. Pass the value as an argument or option instead (see "herd help php:inst
  all").


php:install [<version>]

exit=1
Lingua principale
Nessun dato sulla lingua
Stelle
124
Fork
1
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di beyondcode/herd-community

Tutte le issue di beyondcode/herd-community

Issue simili

Altre issue su CLI

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.