Search code examples
phpmysqliphp-extension

Unable to compile PHP 5.2 with mysqli extension


I am compiling PHP version 5.2 with mysql extension mysqli

bellow are the steps

  1. Configure

sudo ./configure --with-mysqli=/opt/mysql/server-5.1/bin/mysql_config

[It's working fine mysql version is 5.1 i have also try with latest]

  1. make

make

[After make bellow error i am getting]

-lmysqlclient -lz -lcrypt -lnsl -lm -lxml2 -lcrypt -lxml2 -lxml2 -lxml2 -lcrypt -o sapi/cgi/php-cgi ext/mysqli/mysqli_repl.o: In function zif_mysqli_disable_reads_from_master': /usr/local/src/php5-build/php-5.2.5/ext/mysqli/mysqli_repl.c:43: undefined reference tomysql_disable_reads_from_master' ext/mysqli/mysqli_repl.o: In function zif_mysqli_disable_rpl_parse': /usr/local/src/php5-build/php-5.2.5/ext/mysqli/mysqli_repl.c:59: undefined reference tomysql_disable_rpl_parse' ext/mysqli/mysqli_repl.o: In function zif_mysqli_enable_reads_from_master': /usr/local/src/php5-build/php-5.2.5/ext/mysqli/mysqli_repl.c:76: undefined reference tomysql_enable_reads_from_master' ext/mysqli/mysqli_repl.o: In function zif_mysqli_enable_rpl_parse': /usr/local/src/php5-build/php-5.2.5/ext/mysqli/mysqli_repl.c:93: undefined reference tomysql_enable_rpl_parse' ext/mysqli/mysqli_repl.o: In function zif_mysqli_master_query': /usr/local/src/php5-build/php-5.2.5/ext/mysqli/mysqli_repl.c:111: undefined reference tomysql_master_query' ext/mysqli/mysqli_repl.o: In function zif_mysqli_rpl_parse_enabled': /usr/local/src/php5-build/php-5.2.5/ext/mysqli/mysqli_repl.c:130: undefined reference tomysql_rpl_parse_enabled' ext/mysqli/mysqli_repl.o: In function zif_mysqli_rpl_probe': /usr/local/src/php5-build/php-5.2.5/ext/mysqli/mysqli_repl.c:147: undefined reference tomysql_rpl_probe' ext/mysqli/mysqli_repl.o: In function zif_mysqli_rpl_query_type': /usr/local/src/php5-build/php-5.2.5/ext/mysqli/mysqli_repl.c:168: undefined reference tomysql_rpl_query_type' ext/mysqli/mysqli_repl.o: In function zif_mysqli_slave_query': /usr/local/src/php5-build/php-5.2.5/ext/mysqli/mysqli_repl.c:207: undefined reference tomysql_slave_query' collect2: ld returned 1 exit status make: * [sapi/cgi/php-cgi] Error 1

Please let me know the solution


Solution

  • I have run this command

    sudo ./configure --disable-all --with-mysql=/opt/mysql/server-5.1/ --with-mysqli=/opt/mysql/server-5.1/bin/mysql_config

    and it's working in my previous command i am missing the /opt/mysql/server-5.1/