|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54644 wrong pathes in php_pdo_mysql_int.h
Submitted: 2011-05-01 14:15 UTC Modified: 2011-05-09 13:35 UTC
From: public at grik dot net Assigned: mysql (profile)
Status: Closed Package: PDO related
PHP Version: 5.3.6 OS: unix
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:
Solve the problem:
41 - 15 = ?
Subscribe to this entry?

 [2011-05-01 14:15 UTC] public at grik dot net
in ext/pdo_mysql/php_pdo_mysql_int.h you have
#if defined(PDO_USE_MYSQLND)
# include "ext/mysqlnd/mysqlnd.h"
# include "ext/mysql/mysql_mysqlnd.h"
# include "ext/mysqlnd/mysqlnd_libmysql_compat.h"
#if defined(PDO_USE_MYSQLND)
#include "ext/mysqlnd/mysqlnd_debug.h"

so when I tried to re-compile the pdo_mysql extension from the extension folder 
using `phpize;configure--with-pdo-mysql=mysqlnd;make`, it barkled that can't find 
I changed to #include "../../ext/mysqlnd/mysqlnd_debug.h"
and compiled the extension, but that's obviously not a solution.

Test script:

Expected result:
Build complete.
Don't forget to run 'make test'.

Actual result:
In file included from /usr/src/web/php-5.3.6/ext/pdo_mysql/pdo_mysql.c:32:
/usr/src/web/php-5.3.6/ext/pdo_mysql/php_pdo_mysql_int.h:28:38: error: 
ext/mysql/mysql_mysqlnd.h: No such file or directory


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-02 11:41 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: mysql
 [2011-05-02 11:41 UTC]
How did you compile and install PHP? Are you sure you have a clean installation and not a mixture of different PHPs? It works for me properly. Also: what kind of Unix are you using?
 [2011-05-02 13:26 UTC] public at grik dot net
-Status: Feedback +Status: Assigned
 [2011-05-02 13:26 UTC] public at grik dot net
yes, I am sure, I download PHP archive from this site and compile it manually 

It does not matter how I compile. Just open php-
and look at lines 27-29

You can compile only from the root folder of the archive, but if you want to 
build the extension separately with phpize, you need to edit the source.
 [2011-05-02 13:32 UTC]
-Status: Assigned +Status: Feedback
 [2011-05-02 13:32 UTC]
To compile the extension stand-alone you need an installed PHP. I was asking about that.
 [2011-05-02 13:40 UTC] public at grik dot net
-Status: Feedback +Status: Assigned
 [2011-05-02 13:40 UTC] public at grik dot net
yes, I have it installed. It was a re-compilation of an extension due to another 

I understand you are busy and abused by reports, but this is not that case.
I managed to recompile it after patching the header file.

Please re-read the description.
 [2011-05-02 14:43 UTC]
-Status: Assigned +Status: Feedback
 [2011-05-02 14:43 UTC]
The mysqlnd.h file inside the distribution is *not* the file you are looking for. You are looking for a file installed on your system. The installation where "phpize" is coming from.
 [2011-05-02 19:11 UTC] public at grik dot net
-Status: Feedback +Status: Assigned
 [2011-05-02 19:11 UTC] public at grik dot net

# tar -xjf php-5.3.6.tar.bz2
mysqli]# cd php-5.3.6/ext/mysqli/
mysqli]# phpize; ./configure --with-mysqli=mysqlnd; make
Build complete.
Don't forget to run 'make test'.
mysqli]# cd ../pdo_mysql/
pdo_mysql]# phpize;./configure --with-pdo-mysql=mysqlnd;make
In file included from /usr/src/web/php-5.3.6/ext/pdo_mysql/pdo_mysql.c:32:
/usr/src/web/php-5.3.6/ext/pdo_mysql/php_pdo_mysql_int.h:28:38: error: 
ext/mysql/mysql_mysqlnd.h: No such file or directory
make: *** [pdo_mysql.lo] Error 1

# php -v
PHP 5.3.6 (cli) (built: Apr 30 2011 21:21:49) (DEBUG)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

pdo_mysql]# cd ../..
php-5.3.6]# ./configure --with-pdo-mysql=mysqlnd;make

Build complete.
Don't forget to run 'make test'.

What else can I show you?
 [2011-05-02 20:19 UTC] public at grik dot net
There is one phpize in the system, and I reinstalled PHP to ensure the error 
mysqlnd.h exists and is present in the proper folder

[root@devel php-5.3.6]# whereis phpize
phpize: /usr/local/bin/phpize

[root@devel php-5.3.6]# phpize -v
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626

[root@devel php-5.3.6]# locate mysqlnd.h

[root@devel php-5.3.6]# ll /usr/local/include/php/ext/mysqlnd/mysqlnd.h
-rw-r--r-- 1 root root 17088 2011-05-02 20:49 

[root@devel php-5.3.6]# php-config --includes
-I/usr/local/include/php -I/usr/local/include/php/main -
I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -
I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
 [2011-05-02 21:12 UTC]
The problem is quite weird. 
I guess this line:
#      include "ext/mysql/mysql_mysqlnd.h" some kind of leftover from the good ol' times when mysqlnd was a part of ext/mysql/; at least nothing breaks if I remove it.

So the patch is as easy as this:
--- php_pdo_mysql_int.h (revision 307861)
+++ php_pdo_mysql_int.h (working copy)
@@ -25,7 +25,6 @@

 #if defined(PDO_USE_MYSQLND)
 #      include "ext/mysqlnd/mysqlnd.h"
-#      include "ext/mysql/mysql_mysqlnd.h"
 #      include "ext/mysqlnd/mysqlnd_libmysql_compat.h"
 [2011-05-02 21:20 UTC]
There's also another issue: you can't install mysqlnd itself, you have to install one of the extensions using it. So in order to build shared version of PDO_MYSQL with myslnd you have to build ext/mysql with myslnd *statically*.
I believe ext/mysqlND should be full-grown extension with its own --enable-mysqlnd option, this was you could build it separately AND still be able to use your automagic with $PHP_MYSQLND_ENABLED.
 [2011-05-02 22:32 UTC] public at grik dot net
-Status: Assigned +Status: Closed
 [2011-05-02 22:32 UTC] public at grik dot net

I am sorry for the wrong initial description, complaining at # include 
"ext/mysqlnd/mysqlnd.h" while the error clearly told about 
 [2011-05-03 06:56 UTC]
-Status: Closed +Status: Assigned
 [2011-05-03 06:56 UTC]
I didn't commit the patch yet, I still want to hear from the MySQL guys first.
Also it's their domain, not mine.
 [2011-05-03 09:21 UTC]
you are not exactly right. ext/mysql/mysql_mysqlnd.h is not a left-over. If you take a look into ext/mysqli you will find mysqli_mysqlnd.h, which is larger but follows the same schema - ext_driver (mysqli_libmysql.h exists). However, mysql_myslqnd.h is so small, that it could be incorporated into another file, if wanted.

 [2011-05-04 20:49 UTC]
Andrey, whatever that header is, its contents is not used in PDO_MYSQL and the header itself is not installed, which means there's not way to build PDO_MYSQL+mysqlnd dynamically.
 [2011-05-09 13:34 UTC]
Automatic comment from SVN on behalf of johannes
Log: - Fix bug #54644 (wrong pathes in php_pdo_mysql_int.h)
 [2011-05-09 13:35 UTC]
-Status: Assigned +Status: Closed
 [2011-05-09 13:35 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Jan 19 17:03:13 2022 UTC