Turn from the sky speed blog http://www.siutung.org/post/446/
During the upgrade of php5-extensions in FreeBSD, mysqli could not be compiled properly, error prompt:
=> Building for php5-mysqli-5.2.12_2
/Bin/sh
/Usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/libtool
-- Mode = compile cc-I.
-I/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli
-DPHP_ATOM_INC
-I/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/include
-I/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/main
-I/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli
-I/usr/local/include/php/main
-I/usr/local/include/php/TSRM-I/usr/local/include/php/Zend
-I/usr/local/include/php/ext/date/lib
-I/usr/local/include/mysql-DHAVE_CONFIG_H-O2-pipe
-Fno-strict-aliasing-c
/Usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli. c-o
Mysqli. lo
Mkdir. libs
Cc-I.
-I/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli
-DPHP_ATOM_INC
-I/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/include
-I/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/main
-I/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli
-I/usr/local/include/php/main
-I/usr/local/include/php/TSRM-I/usr/local/include/php/Zend
-I/usr/local/include/php/ext/date/lib
-I/usr/local/include/mysql-DHAVE_CONFIG_H-O2-pipe
-Fno-strict-aliasing-c
/Usr/ports/databases/php5-mysqli/work/php-5.2.12/EXT/mysqli. c
-FPIC-dpic-o. libs/mysqli. o
/Usr/ports/databases/php5-mysqli/work/php-5.2.12/EXT/mysqli. C: In function 'zm _ startup_mysqli ':
/Usr/ports/databases/php5-mysqli/work/php-5.2.12/EXT/mysqli. C: 637:
Error: 'mysql _ rpl_master 'undeclared (first use in this function)
/Usr/ports/databases/php5-mysqli/work/php-5.2.12/EXT/mysqli. C: 637:
Error: (each undeclared identifier is reported only once
/Usr/ports/databases/php5-mysqli/work/php-5.2.12/EXT/mysqli. C: 637: Error: for each function it appears in .)
/Usr/ports/databases/php5-mysqli/work/php-5.2.12/EXT/mysqli. C: 638:
Error: 'mysql _ rpl_slave 'undeclared (first use in this function)
/Usr/ports/databases/php5-mysqli/work/php-5.2.12/EXT/mysqli. C: 639:
Error: 'mysql _ RPL_ADMIN 'undeclared (first use in this function)
* ** Error code 1
1 error
* ** Error code 1
Stop in/usr/ports/databases/php5-mysqli.
==>>> Make failed for databases/php5-mysqli
==>>> Aborting update
==>>> Update for databases/php5-mysqli failed
==>>> Aborting update
Cause: This is a mysql bug, http://bugs.php.net/bug.php? Id = 46207 & edit = 1
, Already submitted.
Solution:
Modify/usr/local/include/mysql. h
File Content:
Enum mysql_protocol_type
{
MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
};
---------------------------- = Start of the added content == -------------------------------------
/*
There are three types of queries-the ones that have to go
The master, the ones that go to a slave, and the adminstrative
Type which must happen on the specified connectioin
*/
Enum mysql_rpl_type
{
MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
};
---------------------------- = End of the added content == --------------------------------------
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 */
Add the above blue content to the corresponding position of mysql. h file and re-compile it.
NND, which almost caused me to reinstall mysql.