Bug #70854 [Csd->Nab]: Mysqli connection problem
| From: | requinix@php.net | Date: | Wed, 04 Nov 2015 18:13:14 +0000 |
| Subject: | Bug #70854 [Csd->Nab]: Mysqli connection problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-197028@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70854&edit=1
ID: 70854
Updated by: requinix@php.net
Reported by: rmoisto at gmail dot com
Summary: Mysqli connection problem
-Status: Closed
+Status: Not a bug
Type: Bug
Package: MySQLi related
Operating System: Ubuntu 15.10
PHP Version: 7.0.0RC6
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2015-11-04 15:26:56] rmoisto at gmail dot com
Fixed by setting mysqli.default_socket in php.ini
------------------------------------------------------------------------
[2015-11-04 15:04:07] rmoisto at gmail dot com
Seems I was not looking at my error log quite right, there's also an issue with connecting.
Simpler test script:
<?php
$mysqli = new mysqli('localhost', 'root', 'password');
$mysqli->select_db('db');
Full Warning:
2015/11/04 16:58:17 [error] 20107#0: *2075 FastCGI sent in stderr: "PHP message: PHP Warning:
mysqli::__construct(): (HY000/2002): No such file or directory in
/var/www/enternum/public_html/test.php on line 2
PHP message: PHP Warning: mysqli::select_db(): Couldn't fetch mysqli in
/var/www/public_html/test.php on line 3" while reading response header from upstream, client:
127.0.0.1, server: localhost, request: "GET /test.php HTTP/1.1", upstream:
"fastcgi://unix:/var/run/php7-fpm.sock:", host: "localhost"
------------------------------------------------------------------------
[2015-11-04 14:50:35] rmoisto at gmail dot com
Description:
------------
The select_db function does not work and produces a Warning when using a class that extends mysqli.
This worked perfectly with PHP 5.6. As I have both PHP versions installed on this computer I
switched between them several times to confirm this.
I'm using PHP 7 RC6 that I compiled from source.
The web server is nginx, using PHP with FPM.
Test script:
---------------
<?php
class MyMysqli extends mysqli {
public function e_select_db($db) {
return $this->select_db($db);
}
}
$mysqli = new MyMysqli('localhost', 'root', 'password');
$mysqli->e_select_db('db');
Expected result:
----------------
Database is selected.
Actual result:
--------------
Database is not selected.
Also, the following Warning is written to the error log:
PHP message: PHP Warning: mysqli::select_db(): Couldn't fetch MyMysqli in
/var/www/public_html/test.php on line 4" while reading response header from upstream, client:
127.0.0.1, server: localhost, request: "GET /test.php HTTP/1.1", upstream:
"fastcgi://unix:/var/run/php7-fpm.sock:", host: "localhost"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70854&edit=1