Use the php mysqli extension to operate the mysql database. It is an enhanced version of the mysql extension library. It has improved efficiency and security. It supports object-oriented programming and also provides a process-oriented programming style.
1. Installation steps
1. Find mysqli
2 in the php7.2 ext directory. Enter /usr/local/php7.2/bin/phpize
3 and execute ./configure --with-php-config=/usr/local/php/bin/php-config in the mysqli folder --with-mysqli=/usr/bin/mysql_config
4, make
5, make install
2. Pitfalls encountered
Question 1: If mysql_config cannot be found, it may be that mysql-devel is not installed
Solution steps
1. You need to install the source of MySQL
2. At this time, the relevant repo of MySQL will appear in the /etc/yum.repos.d/ directory
3. yum install mysql-devel
Question 2: When installing mysqli, an error occurs: ext/mysqlnd/mysql_float_to_double.h: No such file or directory
Solution steps
1. vim /home/tmp/php-7.2.11/ext/mysqli/mysqli_api.c (find your installation directory here )
2. Modify the path on line 36 of the file
/ext/mysqlnd/mysql_float_to_double.h
Modify it to
/home/tmp/php -7.2.11/ext/mysqlnd/mysql_float_to_double.h
Recommended learning: php video tutorial
The above is the detailed content of How to install mysqli extension in php7. For more information, please follow other related articles on the PHP Chinese website!