解决php5.4安装pdo_mysql出错
时间:2021-07-01 10:21:17
帮助过:20人阅读
系统:centos 5.5 需要的软件:httpd-2.2.22.tar.gz php-5.4.11.tar.gz mysql-5.5.22.tar.gz PDO_MYSQL-1.0.2.tgz libiconv-1.14.tar.gz1.安装前准备yum -y install gcc gcc-c++ libtool-libs autoconf /freetype-devel gd libjpeg-devel libpng-devel libxml2-devel /ncurses-devel zlib-devel zip unzip curl-devel wget crontabs /file bison cmake patch mlocate flex diffutils automake make /kernel-devel cpp readline-devel openssl-devel vim-minimal /glibc-devel glib2-devel bzip2-devel e2fsprogs-devel libidn-devel /gettext-devel expat-devel libcap-devel libtool-ltdl-devel pam-devel /pcre-devel libmcrypt-devel2.搭建lamp环境这个就不说了,网上这样的文章太多了.3.安装PDO_MYSQLwget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgztar zxf PDO_MYSQL-1.0.2.tgz && cd PDO_MYSQL-1.0.2/usr/local/php/bin/phpize./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysqlmake在make的时候有可能会出现下面的错误:In file included from /data1/PDO_MYSQL-1.0.2/pdo_mysql.c:31:/data1/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:25:19: error: mysql.h: No such file or directoryIn file included from /data1/PDO_MYSQL-1.0.2/pdo_mysql.c:31:/data1/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:36: error: expected specifier-qualifier-list before ‘MYSQL’/data1/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:48: error: expected specifier-qualifier-list before ‘MYSQL_FIELD’/data1/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:53: error: expected specifier-qualifier-list before ‘MYSQL_RES’make: *** [pdo_mysql.lo] Error 1解决办法:这是因为在编译时需要mysql的头的文件,而它按默认搜索找不到头文件的位置,所以才出现这个问题.所以要将 /usr/local/mysql/include/ 目录下的mysql头文件链接到 /usr/local/include/ 的目录下:ln -s /usr/local/mysql/include/* /usr/local/include/然后再make和make install,pdo_mysql模块加进去了.解决php5.4安装pdo_mysql出错
标签:解决php5.4安装pdo_mysql出错