|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-07-21 18:30 UTC] itaylorswift365 at gmail dot com
-Package: MySQL related
+Package: MySQLi related
[2018-07-21 18:30 UTC] itaylorswift365 at gmail dot com
[2018-07-22 01:16 UTC] no at mail dot here
[2018-07-23 15:09 UTC] johannes@php.net
-Assigned To:
+Assigned To: mysql
[2018-07-23 15:09 UTC] johannes@php.net
[2018-07-24 14:25 UTC] itaylorswift365 at gmail dot com
[2018-07-26 20:30 UTC] amenshchikov at gmail dot com
[2018-07-27 15:44 UTC] brayamrivas at gmail dot com
[2018-07-28 07:00 UTC] no at mail dot here
[2018-08-05 19:41 UTC] theodorejb at outlook dot com
[2018-08-06 21:10 UTC] eugene at zhegan dot in
[2018-08-07 07:39 UTC] thaddee at bechtold dot me
[2018-08-09 15:06 UTC] eugene at zhegan dot in
[2018-08-17 08:19 UTC] itaylorswift365 at gmail dot com
[2018-08-25 05:47 UTC] first236108 at 163 dot com
[2018-08-25 06:54 UTC] first236108 at 163 dot com
[2018-08-27 18:55 UTC] no at mail dot here
[2018-08-31 02:06 UTC] 104979058 at qq dot com
[2018-09-03 01:19 UTC] 104979058 at qq dot com
[2018-09-04 04:05 UTC] nikic@php.net
[2018-09-04 09:33 UTC] johannes@php.net
[2018-09-04 13:29 UTC] nikic@php.net
[2018-09-06 08:06 UTC] no at mail dot her
[2018-09-10 18:11 UTC] cmb@php.net
-Status: Assigned
+Status: Closed
[2018-09-10 18:11 UTC] cmb@php.net
[2018-09-14 18:53 UTC] no at mail dot here
[2018-09-16 06:44 UTC] nikic@php.net
[2018-09-16 09:23 UTC] no at mail dot here
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
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