[php-src] Issue #7781: Built-in web server prints HTML tags in terminal when address is wrong
| From: | mauriciofauth | Date: | Wed, 15 Dec 2021 15:09:19 +0000 |
| Subject: | [php-src] Issue #7781: Built-in web server prints HTML tags in terminal when address is wrong | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-238438@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/7781
Author: mauriciofauth
### 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.
```diff
- 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