Bug #76651 [NEW]: Can't establish a connection to MySQL after upgrading PHP from 7.2.7 to 7.2.8

From: Date: Sat, 21 Jul 2018 18:26:52 +0000
Subject: Bug #76651 [NEW]: Can't establish a connection to MySQL after upgrading PHP from 7.2.7 to 7.2.8
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216382@lists.php.net to get a copy of this message
From:             itaylorswift365 at gmail dot com
Operating system: Debian 9.5 x64
PHP version:      7.2.8
Package:          MySQL related
Bug Type:         Bug
Bug description:Can't establish a connection to MySQL after upgrading PHP from 7.2.7 to 7.2.8

Description:
------------
From PHP 7.2.0 to 7.2.7, everytime I compile and build PHP from source
with this opinions: ./configure --enable-mysqlnd --with-mysqli=mysqlnd
--with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql=mysqlnd {...} and
everything looks fine. PHP can connect to MySQL successfully.

But this time I compiled PHP 7.2.8 with the same configure opinions, the
compile and build process was succeeded but after restarting php-fpm, I
got an error that "MySQL Servr is Gone". But MySQL process was still
running out there, I was confused. So I wrote a PHP script to figure out
where the problem was. And I got this error "Connect DATABASE Error
TYPE: 2002: Permission denied". So I checked the socket file permission
of both PHP and MySQL, I got this: php socket file permission was 0660
while MySQL was 0777. And I made another test that if I downgrade PHP
from 7.2.8 to 7.2.7, after restarting php-fpm, it could establish a
successful connection to MySQL. Running the same script got "Success: A
proper connection to MySQL was made! The database is great. Host
information: Localhost via UNIX socket"

So running PHP 7.2.7 looks fine but there is a MySQL connection problem
if running PHP 7.2.8.

(I use the default php.ini)

Test script:
---------------
<?php
$link = mysqli_connect("localhost", "user", "pass",
"dbname");

if (!$link) {
    echo "Error: Unable to connect to MySQL." . PHP_EOL;
    echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
    echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
    exit;
}

echo "Success: A proper connection to MySQL was made! The database is
great." . PHP_EOL;
echo "Host information: " . mysqli_get_host_info($link) . PHP_EOL;

mysqli_close($link);
?>

Expected result:
----------------
Success: A proper connection to MySQL was made! The my_db database is
great. Host information: Localhost via UNIX socket

Actual result:
--------------
Connect DATABASE Error TYPE: 2002: Permission denied

-- 
Edit bug report at https://bugs.php.net/bug.php?id=76651&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=76651&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=76651&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=76651&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=76651&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=76651&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=76651&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=76651&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=76651&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=76651&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=76651&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=76651&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=76651&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=76651&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76651&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=76651&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=76651&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=76651&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76651&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=76651&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=76651&r=mysqlcfg



Thread (22 messages)

« previous php.bugs (#216382) next »