search
HomeBackend DevelopmentPHP7How 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.

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
PHP Fatal error: Call to undefined function mysqli_connect()的解决方法PHP Fatal error: Call to undefined function mysqli_connect()的解决方法Jun 23, 2023 am 09:40 AM

在使用PHP编写Web应用程序时,经常会使用MySQL数据库来存储数据。PHP提供了一种与MySQL数据库进行交互的方法,称为MySQLi。然而,有时在使用MySQLi时,会遇到一个错误信息,如以下所示:PHPFatalerror:Calltoundefinedfunctionmysqli_connect()这个错误信息意味着PHP无法找到my

php无法连接mysqli怎么办php无法连接mysqli怎么办Nov 09, 2022 am 10:07 AM

php无法连接mysqli的解决办法:1、打开“php.ini”文件;2、找到“mysqli.reconnect”;3、将“mysqli.reconnect = OFF”改成“mysqli.reconnect = on”即可。

php7检测tcp端口不好用怎么解决php7检测tcp端口不好用怎么解决Mar 22, 2023 am 09:30 AM

在php5中,我们可以使用fsockopen()函数来检测TCP端口。这个函数可以用来打开一个网络连接和进行一些网络通信。但是在php7中,fsockopen()函数可能会遇到一些问题,例如无法打开端口、无法连接到服务器等。为了解决这个问题,我们可以使用socket_create()函数和socket_connect()函数来检测TCP端口。

PHP PDO 与 mysqli:比较和对比PHP PDO 与 mysqli:比较和对比Feb 19, 2024 pm 12:24 PM

PDOPDO是一个面向对象的数据库访问抽象层,它为PHP提供了一个统一的接口,允许您使用相同的代码与不同的数据库(如Mysql、postgresql、oracle)进行交互。PDO隐藏了底层数据库连接的复杂性,简化了数据库操作。优缺点优点:统一接口,支持多种数据库简化数据库操作,降低开发难度提供预处理语句,提高安全性支持事务处理缺点:性能可能比原生扩展稍低依赖外部库,可能会增加开销演示代码使用PDO连接mysql数据库:$db=newPDO("mysql:host=localhost;dbnam

mysql的运行文件是什么mysql的运行文件是什么Apr 11, 2023 am 10:38 AM

mysql的运行文件是mysqld;mysqld是一个可执行文件,代表着Mysql服务器程序,执行这个文件可以直接启动一个服务器进程;而mysqld_safe是一个启动脚本,它会间接调用mysqld,并且还会顺带启动一个监控进程。

php7.0怎么安装mongo扩展php7.0怎么安装mongo扩展Nov 21, 2022 am 10:25 AM

php7.0安装mongo扩展的方法:1、创建mongodb用户组和用户;2、下载mongodb源码包,并将源码包放到“/usr/local/src/”目录下;3、进入“src/”目录;4、解压源码包;5、创建mongodb文件目录;6、将文件复制到“mongodb/”目录;7、创建mongodb配置文件并修改配置即可。

PHP Warning: mysqli_connect(): (HY000/2002): Connection refused的解决方法PHP Warning: mysqli_connect(): (HY000/2002): Connection refused的解决方法Jun 23, 2023 am 08:54 AM

如果你使用PHP连接MySQL数据库时遇到了以下错误提示:PHPWarning:mysqli_connect():(HY000/2002):Connectionrefused那么你可以尝试按照下面的步骤来解决这个问题。确认MySQL服务是否正常运行首先应该检查MySQL服务是否正常运行,如果服务未运行或者启动失败,就可能会导致连接被拒绝的错误。你可

php7.0安装了插件还是显示未安装怎么办php7.0安装了插件还是显示未安装怎么办Apr 02, 2024 pm 07:39 PM

解决 PHP 7.0 中插件未显示已安装问题的方法:检查插件配置并启用插件。重新启动 PHP 以应用配置更改。检查插件文件权限,确保其正确。安装丢失的依赖项,以确保插件正常运行。如果其他步骤均失败,则重建 PHP。其他可能原因包括插件版本不兼容、加载错误版本或 PHP 配置问题。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.