How to install mysqli in php7
How to install mysqli in php7: 1. Install the mysqli extension through make install; 2. Find the path to php.ini through phpinfo; 3. Uncomment php_mysqi.dll.
The operating environment of this article: Windows7 system, php-7.1.5, Dell G3.
php7 How to install mysqli?
centos php7 Installation experience of mysqli extension
When I configured the new server, I found that php could not Connect to mysql. Discovered via phpinfo. The relevant configuration of mysqli is not displayed at all. After a series of studies. Summarized. :
Step one:
There is no mysqli configuration in phpinfo because there is no configure mysqli when installing php7
Installation method of php: wget http://cn2.php .net/distributions/php-7.1.5.tar.gz
tar zxvf php-7.1.5.tar.gz cd php-7.1.5 ./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/bin/mysql_config 注:/usr/bin/mysql_config 这个路径为自己的mysql_config路径 可通过 find -name mysql_config查找 make && make install cp php.ini-development /usr/local/lib/php.ini cp sapi/fpm/init.d.php-fpm /etc/init.d/php7-fpm chmod +x /etc/init.d/php7-fpm cd /usr/local/php/etc cp php-fpm.conf.default php-fpm.conf cp php-fpm.d/www.conf.default php-fpm.d/www.conf /etc/init.d/php7-fpm start 启动php
After installation, you will find that phpinfo has mysqli
Step 2: Install the mysqli extension
Method:
cd /usr/local/php-7.1.5/ext/mysqli //到php文件ext下的mysqli /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/bin/mysql_config
Note: usr/bin/mysql_config path is the same as the first step method
make make test make install
Now there should be a mysqli extension
The third step :
Modify php.ini
Find the path to php.ini through phpinfo. Modify php.ini. Uncomment php_mysqi.dll
End!
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to install mysqli in php7. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



When writing web applications using PHP, a MySQL database is often used to store data. PHP provides a way to interact with the MySQL database called MySQLi. However, sometimes when using MySQLi, you will encounter an error message, as shown below: PHPFatalerror:Calltoundefinedfunctionmysqli_connect() This error message means that PHP cannot find my

PDOPDO is an object-oriented database access abstraction layer that provides a unified interface for PHP, allowing you to use the same code to interact with different databases (such as Mysql, postgresql, oracle). PDO hides the complexity of underlying database connections and simplifies database operations. Advantages and Disadvantages Advantages: Unified interface, supports multiple databases, simplifies database operations, reduces development difficulty, provides prepared statements, improves security, supports transaction processing Disadvantages: performance may be slightly lower than native extensions, relies on external libraries, may increase overhead, demo code uses PDO Connect to mysql database: $db=newPDO("mysql:host=localhost;dbnam

Solution to php unable to connect to mysqli: 1. Open the "php.ini" file; 2. Find "mysqli.reconnect"; 3. Change "mysqli.reconnect = OFF" to "mysqli.reconnect = on".

How to install the mongo extension in php7.0: 1. Create the mongodb user group and user; 2. Download the mongodb source code package and place the source code package in the "/usr/local/src/" directory; 3. Enter "src/" directory; 4. Unzip the source code package; 5. Create the mongodb file directory; 6. Copy the files to the "mongodb/" directory; 7. Create the mongodb configuration file and modify the configuration.

In php5, we can use the fsockopen() function to detect the TCP port. This function can be used to open a network connection and perform some network communication. But in php7, the fsockopen() function may encounter some problems, such as being unable to open the port, unable to connect to the server, etc. In order to solve this problem, we can use the socket_create() function and socket_connect() function to detect the TCP port.

To resolve the plugin not showing installed issue in PHP 7.0: Check the plugin configuration and enable the plugin. Restart PHP to apply configuration changes. Check the plugin file permissions to make sure they are correct. Install missing dependencies to ensure the plugin functions properly. If all other steps fail, rebuild PHP. Other possible causes include incompatible plugin versions, loading the wrong version, or PHP configuration issues.

If you encounter the following error message when using PHP to connect to a MySQL database: PHPWarning:mysqli_connect():(HY000/2002):Connectionrefused, then you can try to solve this problem by following the steps below. To confirm whether the MySQL service is running normally, you should first check whether the MySQL service is running normally. If the service is not running or fails to start, it may cause a connection refused error. you can

The running file of mysql is mysqld; mysqld is an executable file, which represents the Mysql server program. Executing this file can directly start a server process; and mysqld_safe is a startup script, which will indirectly call mysqld and also start a monitor. process.
