Home>Article>Backend Development> How to install mysqli extension in php7
How to install the mysqli extension in php7: 1. Find mysqli in the ext directory and execute the phpize command; 2. Execute the [./configure] command in the mysqli folder; 3. Execute the [make install] command.
The operating environment of this article: centos 7 system, php 7, thinkpad t480 computer.
The following is how to install the mysqli extension in PHP 7. Let’s take a look at it together.
1. Find mysqli in the php7.2 ext directory.
2. Enter /usr/local/php7.2/bin/phpize
3. In Execute ./configure in the mysqli folder --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/bin/mysql_config
4, make
5. make install
2. Errors encountered during the installation process and solutions
Problem 1: If mysql_config cannot be found, mysql-devel may not be installed
Need to install the source of MySQL
At this time, the relevant repo of MySQL will appear in the /etc/yum.repos.d/ directory
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
to
/home/tmp/php-7.2.11/ext/mysqlnd/mysql_float_to_double.h
Recommended learning:php training
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!