Home  >  Article  >  Backend Development  >  How to install mysqli in php7 and encounter pitfalls

How to install mysqli in php7 and encounter pitfalls

藏色散人
藏色散人Original
2020-08-15 10:38:323184browse

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.

How to install mysqli in php7 and encounter pitfalls

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn