[php-src] Issue #8396: test broken after build
| From: | evrinoma | Date: | Mon, 18 Apr 2022 18:33:43 +0000 |
| Subject: | [php-src] Issue #8396: test broken after build | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241057@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8396
Author: evrinoma
### Description
Hi.
I try to build php engine from source code and I've got an error
**Bug #80067 (Omitting the port in bindto setting errors)
[ext/standard/tests/network/bug80067.phpt]**
I tried to solve the problem by I built openssl.so and ran the test with openssl lib inside the
ext/standard folder, and the test was fine.
Also I faced with strange name config.m4 inside the ext/openssl folder, that's why I
couldn't run phpize fine to solve this problem I've renamed config0.m4 to config.m4
The following code:
```php
--TEST--
Bug #80067 (Omitting the port in bindto setting errors)
--SKIPIF--
<?php
if (getenv("SKIP_ONLINE_TESTS")) die('skip online test');
?>
--FILE--
<?php
$context = stream_context_create(['socket' => ['bindto' =>
'0']]);
var_dump(file_get_contents('https://httpbin.org/get', false, $context) !==
false);
?>
--EXPECT--
bool(true)
```
Resulted in this output:
```
Bug #80067 (Omitting the port in bindto setting errors) [ext/standard/tests/network/bug80067.phpt]
```
Actually it looks strange trying to run test without openssl support, and it should be disabled
The following code instead:
```php
--TEST--
Bug #80067 (Omitting the port in bindto setting errors)
--SKIPIF--
<?php
if (getenv("SKIP_ONLINE_TESTS")) die('skip online test');
if (!in_array('https', stream_get_wrappers())) die('skip: https wrapper is
required');
?>
--FILE--
<?php
$context = stream_context_create(['socket' => ['bindto' =>
'0']]);
var_dump(file_get_contents('https://httpbin.org/get', false, $context) !==
false);
?>
--EXPECT--
bool(true)
```
Resulted in this output:
```
bool(true)
```
build params
./configure' '--build=x86_64' '--with-config-file-path=/usr/local/etc/php'
'--with-config-file-scan-dir=/usr/local/etc/php/conf.d'
'--enable-option-checking=fatal' '--with-mhash' '--disable-all'
'--with-pic' '--with-password-argon2' '--with-zlib'
'--enable-xml' '--with-libxml' '--disable-phpdbg'
'--with-pear' '--disable-cgi' '--enable-fpm'
'--with-fpm-user=www-data' '--with-fpm-group=www-data'
'build_alias=x86_64'
### PHP Version
PHP 7.4.29
### Operating System
_No response_