PHP5.4安装pdo_MySQL失足的解决办法_数据恢复破解版
日期:2013-10-01 / 人气: / 来源:网络
系统: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.gz
1.安装前准备
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-devel
2.搭建lamp环境
这个就不说了,网上这样的文章太多了.
3.安装PDO_MYSQL
wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz
tar 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/mysql
make
在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 directory
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: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模块加进去了.
Linux系统MySQL目录的设置方法
本篇分享了Linux系统MySQL目录的设置方法,希望对于初学Nginx服务器相关的朋友有帮助,更多Nginx安装、配置、报错处理等资源请本站内搜索。。
MySQL PHP环境
作者:管理员
推荐内容 Recommended
- 江苏飞浩信息科技期待您的加入07-20
- 江苏飞浩科技欢迎您07-19
相关内容 Related
- 江苏飞浩信息科技期待您的加入07-20
- 江苏飞浩科技欢迎您07-19