php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74499 Regression using `host:port` on mysqli constructor
Submitted: 2017-04-25 16:47 UTC Modified: 2017-04-25 16:51 UTC
From: jorge at bitnami dot com Assigned:
Status: Duplicate Package: MySQLi related
PHP Version: 7.1.4 OS: Debian 8.7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jorge at bitnami dot com
New email:
PHP Version: OS:

 

 [2017-04-25 16:47 UTC] jorge at bitnami dot com
Description:
------------
new mysqli no longer accepts `ip:port` as first parameter (host)

`ip:port` works in PHP 7.1.3 and 7.0.17
`ip:port` does not work in PHP 7.1.4 and 7.0.18

```
# php --version
PHP 7.1.4 (cli) (built: Apr 25 2017 03:19:44) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
```
```
# php --version
PHP 7.0.18 (cli) (built: Apr 25 2017 03:43:44) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
```

Used php official container from https://hub.docker.com/_/php/
Enabled mysqli module with `docker-php-ext-install mysqli`


Test script:
---------------
<?php
$servername = "ensembldb.ensembl.org:3306";
$username = "anonymous";
$password = "";
$conn = new mysqli($servername, $username, $password);

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 
echo "Connected successfully";
?>

Expected result:
----------------
Connected successfully

Actual result:
--------------
PHP Warning:  mysqli::__construct(): (HY000/2002): Failed to parse address "ensembldb.ensembl.org:3306:3306" in /root/pepe.php on line 7
Connection failed: Failed to parse address "ensembldb.ensembl.org:3306:3306"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-25 16:51 UTC] peehaa@php.net
-Status: Open +Status: Duplicate
 [2017-04-25 16:51 UTC] peehaa@php.net
Dupe of 74432
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Dec 09 05:03:34 2021 UTC