I'm attempting to implement a mysql logger similar to what is described in the following article using the mysqlnd_uh extension.
http://blog.mayflower.de/archives/578-MySQLnd-Plugins-Writing-a-MySQL-Query-Logger-in-PHP.html
How it's supposed to work is that it will intercept calls that go into mysql and mysqli functions into a proxy class where we can intercept the call for logging purposes. Naturally this client library requires the Mysql native driver which isn't installed with PHP 5.3 so I followed the procedures in this tutorial in order to check out the source code of Apache and PHP and compile them onto my VM running the latest version of Ubuntu with compiling options for mysqli and mysql set to mysqlnd.
http://www.web-tech-india.com/articles/php/compiling_php_apache/
That seemed to work well since I can access the mysqli_fetch_all function which is only supported from within mysqlnd.
Now what I am attempting to do is to install the mysqlnd_uh plugin using pecl.
sudo /home/jason/pear/bin/pecl install mysqlnd_uh-alpha
This runs ok for the configure part but fails in the make with the following error. Clearly it's complaining about not finding a source file but where does it look? Should I pass in a parameter into pecl to point to where my copy of the php source code is? In the tutorial it told me to compile apache with the --enable-so option, could that be causing confusion?
running: make
/bin/bash /tmp/pear/install/pear-build-roothNJj2h/mysqlnd_uh-0.1.0a1/libtool --mode=compile cc -I. -I/tmp/pear/install/mysqlnd_uh -DPHP_ATOM_INC -I/tmp/pear/install/pear-build-roothNJj2h/mysqlnd_uh-0.1.0a1/include -I/tmp/pear/install/pear-build-roothNJj2h/mysqlnd_uh-0.1.0a1/main -I/tmp/pear/install/mysqlnd_uh -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/install/mysqlnd_uh/php_mysqlnd_uh.c -o php_mysqlnd_uh.lo
libtool: compile: cc -I. -I/tmp/pear/install/mysqlnd_uh -DPHP_ATOM_INC -I/tmp/pear/install/pear-build-roothNJj2h/mysqlnd_uh-0.1.0a1/include -I/tmp/pear/install/pear-build-roothNJj2h/mysqlnd_uh-0.1.0a1/main -I/tmp/pear/install/mysqlnd_uh -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/install/mysqlnd_uh/php_mysqlnd_uh.c -fPIC -DPIC -o .libs/php_mysqlnd_uh.o
In file included from /tmp/pear/install/mysqlnd_uh/php_mysqlnd_uh.c:23:0:
/tmp/pear/install/mysqlnd_uh/mysqlnd_uh.h:46:33: fatal error: ext/mysqlnd/mysqlnd.h: No such file or directory
compilation terminated.
make: *** [php_mysqlnd_uh.lo] Error 1
ERROR: `make' failed
Thanks for any hints! Jason