Linux loaded mysqli.so

Source: Internet
Author: User
Tags mysql version zts zend

PHP 5.2.3+mysqli installation and common error summary

PHP 5.2.3+mysqli installation and common error summaryRemember that in compiling PHP has already been added parameters
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \ Can later find a, indeed does not exist mysqli.so, so only to compile mysqli alone. Mysqli is a library of optimized MySQL libraries, MySQL version can not be less than 4.1.12
Cd/root/tmp/php-5.2.3/ext/mysqli
# # # #进入到mysqli的目录. Then use Phpize to generate the Configure file:
/usr/local/bin/phpizeconfiguring for:
PHP Api version:20041225
Zend Module Api no:20060613
Zend Extension Api no:220060519
#./configure--prefix=/usr/local/mysqli--with-php-config=/usr/local/bin/php-config--with-mysqli=/usr/bin/mysql_ Configmake
Make installInstalling shared extensions:/usr/local/lib/php/extensions/debug-non-zts-20060613/then in/usr/local/lib/php.ini
Add one sentence:
extension=/usr/local/lib/php/extensions/no-debug-non-zts-20060613/mysqli.so restart Apache to see that the MYSQLI has been loaded successfully.1. If there is an error code:
  1. /root/tmp/php-5.2.3/ext/mysqli/mysqli.c:in function ' zm_startup_mysqli ':
  2. /root/tmp/php-5.2.3/ext/mysqli/mysqli.c:637:error: ' Mysql_rpl_master ' undeclared (first use of this function)
  3. /root/tmp/php-5.2.3/ext/mysqli/mysqli.c:637:error: (Each undeclared identifier was reported only once
  4. /root/tmp/php-5.2.3/ext/mysqli/mysqli.c:637:error:for each function it appears in.)
  5. /root/tmp/php-5.2.3/ext/mysqli/mysqli.c:638:error: ' Mysql_rpl_slave ' undeclared (first use of this function)
  6. /root/tmp/php-5.2.3/ext/mysqli/mysqli.c:639:error: ' Mysql_rpl_admin ' undeclared (first use of this function)
  7. Error Code 1
Modify this file to

Cd/usr/include/mysql
[Email protected] [/usr/include/mysql]# VI mysql.h

In line No. 221
  1. ... ...
  2. Enum Mysql_protocol_type
  3. {
  4. Mysql_protocol_default, Mysql_protocol_tcp, Mysql_protocol_socket,
  5. Mysql_protocol_pipe, Mysql_protocol_memory
  6. };
  7. /*
  8. There is three types of queries-the ones that has to go to
  9. The master, the ones, go to a slave, and the adminstrative
  10. Type which must happen on the pivot connectioin
  11. */


#添加下面的4行
  1. Enum Mysql_rpl_type
  2. {
  3. Mysql_rpl_master, Mysql_rpl_slave, mysql_rpl_admin
  4. };

2. If the following error occurs:/root/tmp/php-5.2.3/ext/mysqli/mysqli_api.c:in function ' Zif_mysqli_stmt_bind_param ':
/root/tmp/php-5.2.3/ext/mysqli/mysqli_api.c:144:error: ' Gptr ' undeclared (first use of this function)
/root/tmp/php-5.2.3/ext/mysqli/mysqli_api.c:144:error: (Each undeclared identifier was reported only once
/root/tmp/php-5.2.3/ext/mysqli/mysqli_api.c:144:error:for each function it appears in.)
/root/tmp/php-5.2.3/ext/mysqli/mysqli_api.c:in function ' Zif_mysqli_stmt_execute ':
/root/tmp/php-5.2.3/ext/mysqli/mysqli_api.c:603:error: ' Gptr ' undeclared (first use of this function)
Make: * * [Mysqli_api.lo] Error 1
Modify this file to
VI Mysqli_api.c Find Allgptr, there are everywhere in line 144, line 150, line 603, line 607, to char* Replacement

Test mysqli Health: Vim mysqli.php<?php
$mysqli = new Mysqli ("localhost", "My_user", "My_password", "dbname");/* Check connection */
if (Mysqli_connect_errno ()) {
printf ("Connect failed:%s\n", Mysqli_connect_error ());
Exit ();
}printf ("Host Information:%s\n", $mysqli->host_info);
/* Close Connection */
$mysqli->close ();
?>

Linux loaded mysqli.so

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.