Home>Article>Backend Development> How to install mysqli extension in php7

How to install mysqli extension in php7

王林
王林 Original
2021-09-06 16:08:53 3654browse

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.

How to install mysqli extension in php7

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

How to install mysqli extension in php7

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!

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