Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Cerrado Apto para principiantes
#1,771 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
83/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
php
Área
cli

Línea de trabajo

Empieza por localizar el comando php:install y comparar su argumento de versión con el argumento phpVersion del comando php:update, tal como se describe en el issue. Consulta la ayuda del comando y reproduce el problema con herd php:install 8.4 para confirmar que se ignora el argumento. La tarea está terminada cuando el comando instala la versión solicitada sin preguntar; verifica el comportamiento interactivo y no interactivo.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

fixed-in-next-release 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
Lenguaje dominante
Sin datos de lenguaje
Estrellas
124
Forks
1
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de beyondcode/herd-community

Todos los issues de beyondcode/herd-community

Issues similares

Más issues de CLI

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.