Support for PHP extended mysqli in Linux systems

Source: Internet
Author: User

Note: The MYSQLI expansion Library is designed to work in conjunction with MySQL 4.1.3 or later


The first two days a site to transfer over, because there are problems to my database, I did not carefully deal with this site. Today the database is ready, found still not use, reported errors are as follows: Fatal error:class ' mysqli ' not found in. Originally I was compiling PHP before, did not put mysqli support compiled in, the solution to the problem is to recompile


To install the mysqli extension of PHP, add--with-mysqli=mysql_config_path/mysql_config when configured. Where Mysql_config_path represents the path to the Mysql_config program, which is released with MySQL greater than 4.1 version


CD php-5.2.8//There's a mysqli in the Ext folder underneath.
CD Ext/mysqli

Linux will be the source file compiled should have configure it, but here is not, after we have installed PHP, php5 folder in the command directory bin there is a file called phpize, use it can generate configure files, continue to

/usr/local/php5/bin/phpize//Here Enter the run, after the execution of the Configure file,
./configure–prefix=/usr/local/mysqli–with-php-config=/usr/local/php5/bin/php-config–with-mysqli=/usr/local/ Mysql/bin/mysql_config

Direct return, no problem will continue.

Make
Make Test
Make Install//(no error will show installing shared extensions:/usr/local/php5/lib/php/extensions/no-debug-non-zts-20041030/)

Now the mysqli.so file is coming out.

It's OK to load this file directly in the php.ini.

Extension_dir= "/usr/local/php5/ext"
Extension=mysqli.so

Find the first line above to change to this, and then add the second line. Wq Save exit.

mysqli.so this file CP to/usr/local/php5/ext.

Restart Apache.


Mysqli-Constructs a new Mysqli object

Method

Autocommit-turn on or off automatically submitted database options
Change_user-Change the user
Character_set_name for the specified database connection-returns the default character set for the database connection
Close-before closing one Open Connection
Commit-commit current transaction
Connect-open a new connection to the MySQL database server
Debug-perform a wrong operation
Dump_debug_info-Get the wrong message
GET_CLI Ent_info-Returns the client version
Get_host_info-Returns the type used by the connection
Get_server_info-Returns the version of the MySQL server
Get_server_version-return to MySQL suit Version of the server
init-Initialize the Mysqli object
Info-Get the information for the most recently executed query
Kill-require the servers to stop a MySQL thread
Multi_query-Execute multiple queries

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.