在安装nginx + mysql + php 的时候出现这样的错误:
/usr/local/src/php-5.2.15/ext/mysqli/mysqli.c:644: error: (Each undeclared identifier is reported only once
/usr/local/src/php-5.2.15/ext/mysqli/mysqli.c:644: error: for each function it appears in.)
/usr/local/src/php-5.2.15/ext/mysqli/mysqli.c:645: error: 'MYSQL_RPL_SLAVE' undeclared (first use in this function)
/usr/local/src/php-5.2.15/ext/mysqli/mysqli.c:646: error: 'MYSQL_RPL_ADMIN' undeclared (first use in this function)
make: *** [ext/mysqli/mysqli.lo] Error 1
这样真正的解决方法是:
修改/usr/local/include/mysql/mysql.h 文件内容:
(mysql.h这个是根据个人安装的mysql路径来找 在mysql下面的include的mysql目录里 别搞错了)
找到
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 */
把红色的区域加入此文件 保存以后重新编译php
希望可以帮助到要帮助的人
阅读(4947) | 评论(0) | 转发(0) |