Home >Database >Mysql Tutorial >How Do I Enable the MySQLi Extension in PHP 7 on Ubuntu?
Enabling the MySQLi Extension in PHP 7
In PHP 7, the MySQLi extension is the preferred method for interacting with MySQL databases. To enable this extension, certain steps must be taken.
Issue:
You have installed PHP 7 and MySQL 5.5.47 on Ubuntu 14.04 but cannot find the MySQLi extension using phpinfo(). phpMyAdmin also indicates that the MySQLi extension is missing.
Solution:
Due to the deprecation of the php5-mysql package, you need to install a new package:
sudo apt-get install php-mysql
This action automatically updates Apache and PHP 7, installing the MySQLi extension.
Restart Apache to complete the installation:
sudo service apache2 restart
Verify the installation by running phpinfo() or checking the php.ini file for the MySQLi extension.
The above is the detailed content of How Do I Enable the MySQLi Extension in PHP 7 on Ubuntu?. For more information, please follow other related articles on the PHP Chinese website!