php5.6.22 mysql_编译php-5.2.6+MySQL 5.6.22报错

(1)问题

在编译php-5.2.6时:

./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/ --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/ --with-libxml-dir=/usr/local/libxml2/ --with-jpeg-dir=/usr/local/jpeg6/ --with-freetype-dir=/usr/local/freetype/ --with-gd=/usr/local/gd2/ --with-mcrypt=/usr/local/libmcrypt/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-sockets

报如下错误:

/software/LAMP_Resource_Package/php-5.2.6/ext/mysqli/mysqli.c: In function 'zm_startup_mysqli':

/software/LAMP_Resource_Package/php-5.2.6/ext/mysqli/mysqli.c:643: error: 'MYSQL_RPL_MASTER' undeclared (first use in this function)

/software/LAMP_Resource_Package/php-5.2.6/ext/mysqli/mysqli.c:643: error: (Each undeclared identifier is reported only once

/software/LAMP_Resource_Package/php-5.2.6/ext/mysqli/mysqli.c:643: error: for each function it appears in.)

/software/LAMP_Resource_Package/php-5.2.6/ext/mysqli/mysqli.c:644: error: 'MYSQL_RPL_SLAVE' undeclared (first use in this function)

/software/LAMP_Resource_Package/php-5.2.6/ext/mysqli/mysqli.c:645: error: 'MYSQL_RPL_ADMIN' undeclared (first use in this function)

make: *** [ext/mysqli/mysqli.lo] 错误 1

(2)原因

(3)解决方法:

修改/usr/local/mysql/include/mysql.h文件中的内容: enum mysql_protocol_type

{

MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,

MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY

};

/*

There are three types of queries - the ones that have to go to

the master, the ones that go to a slave, and the adminstrative

type which must happen on the pivot connectioin

*/

enum mysql_rpl_type

{

MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN

};

typedef struct character_set

{

unsigned int      number;     /* character set number              */

unsigned int      state;      /* character set state               */

const char        *csname;    /* collation name                    */

const char        *name;      /* character set name                */

const char        *comment;   /* comment                           */

const char        *dir;       /* character set directory           */

unsigned int      mbminlen;   /* min. length for multibyte strings */

unsigned int      mbmaxlen;   /* max. length for multibyte strings */

} MY_CHARSET_INFO;

将以上红色加粗的内容,添加到mysql.h文件对应的位置,重新编译php即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值