服务器 Gind.cn

服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器

编译mysqlnd_uh插件

我试图实现一个mysqllogging器类似于下面的文章中描述使用mysqlnd_uh扩展名。 http://blog.mayflower.de/archives/578-MySQLnd-Plugins-Writing-a-MySQL-Query-Logger-in-PHP.html 它应该如何工作的是,它将拦截进入mysql和mysqli函数的调用到代理类中,在那里我们可以拦截调用以进行日志logging。 当然,这个客户端库需要Mysql原生驱动程序,这个驱动程序并没有与PHP 5.3一起安装,所以我按照本教程中的步骤检查了Apache和PHP的源代码,并将它们编译到运行最新版本Ubuntu的虚拟机上编译mysqli和mysql的选项设置为mysqlnd。 http://www.web-tech-india.com/articles/php/compiling_php_apache/ 这似乎工作得很好,因为我可以访问mysqli_fetch_all函数,只有在mysqlnd中支持。 现在我试图做的是使用pecl安装mysqlnd_uh插件。 sudo /home/jason/pear/bin/pecl install mysqlnd_uh-alpha 这对于configuration部分运行正常,但在make中失败,出现以下错误。 显然,它抱怨没有find源文件,但它看起来在哪里? 我应该传入一个参数到pecl指向我的PHP源代码的副本? 在教程中,它告诉我用–enable-so选项编译apache,是否会造成混乱? 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 […]