Built-in web server prints HTML tags in terminal when address is wrong
Nessuno ha ancora preso questa issue.
- Lingua principale
- C
- Stelle
- 40.4k
- Fork
- 8.1k
- Merge medio
- 2g 13h
- PR unite (30g)
- 96
Descrizione
Description
I tried to start the built-in web server, but I mistyped the address and then the PHP cli printed HTML tags in the terminal.
- php -S 0.0.0.0:8080
+ php -S 0.0..0:8080
Resulted in this output:
$ php -S 0.0..0:8080
[Wed Dec 15 11:54:39 2021] PHP Warning: Unknown: php_network_getaddresses: getaddrinfo for 0.0..0 failed: Name or service not known in Unknown on line 0
<br />
<b>Warning</b>: Unknown: php_network_getaddresses: getaddrinfo for 0.0..0 failed: Name or service not known in <b>Unknown</b> on line <b>0</b><br />
[Wed Dec 15 11:54:39 2021] Failed to listen on 0.0..0:8080 (reason: php_network_getaddresses: getaddrinfo for 0.0..0 failed: Name or service not known)
But I expected this output instead:
$ php -S 0.0..0:8080
[Wed Dec 15 12:01:43 2021] PHP Warning: Unknown: php_network_getaddresses: getaddrinfo for 0.0..0 failed: Name or service not known in Unknown on line 0
[Wed Dec 15 12:01:43 2021] Failed to listen on 0.0..0:8080 (reason: php_network_getaddresses: getaddrinfo for 0.0..0 failed: Name or service not known)
PHP version:
PHP 8.1.0 (cli) (built: Nov 25 2021 20:48:52) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.0, Copyright (c) Zend Technologies
with Zend OPcache v8.1.0, Copyright (c), by Zend Technologies
with Xdebug v3.1.1, Copyright (c) 2002-2021, by Derick Rethans
with blackfire v1.72.0~linux-x64-non_zts81, https://blackfire.io, by Blackfire
PHP Version
8.1.0
Operating System
Debian Bookworm
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci il problema con il comando documentato php -S 0.0..0:8080 e analizza il percorso di segnalazione degli errori del server web integrato. Il lavoro è completato quando l’avviso relativo all’indirizzo non valido rimane leggibile nel terminale senza emettere tag HTML, preservando al contempo il messaggio di errore esistente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- php
- Ambito
- cli
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 45/100