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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
33 + 33 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 12:01:27 2024 UTC