Home > Article > Backend Development > How to install mysqli in php7 and encounter pitfalls
How to install mysqli in php7: First find mysqli in the "php7.2 ext" directory; then enter "/usr/local/php7.2/bin/phpize"; then execute " mysql_config"; finally install it.
Recommended: "PHP7"
php7 Pitfalls and solutions for installing the mysqli extension
1. Installation steps
1. Find mysqli in the php7.2 ext directory
2. Enter /usr/local/php7.2/bin/ phpize
3. Execute in the mysqli folder./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/bin/mysql_config
4, make
5, make install
2. Pitfalls
Problem 1: If mysql_config cannot be found, mysql may not be installed. -devel
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
Problem 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
Modified to
/home/tmp/php-7.2.11/ext/mysqlnd/mysql_float_to_double.h
The above is the detailed content of How to install mysqli in php7 and encounter pitfalls. For more information, please follow other related articles on the PHP Chinese website!