Home  >  Article  >  Backend Development  >  How to Install the MySQLi Extension in PHP 7?

How to Install the MySQLi Extension in PHP 7?

Barbara Streisand
Barbara StreisandOriginal
2024-11-15 10:09:03925browse

How to Install the MySQLi Extension in PHP 7?

Troubleshooting MySQLi Extension Issues in PHP 7

It appears that the MySQLi extension is missing from your PHP 7 installation on Ubuntu 14.04. PHPinfo() confirms this absence, rendering tools such as phpMyAdmin inaccessible due to their reliance on MySQLi.

Understanding the Deprecation of PHP5-mysql

Previously, PHP used the php5-mysql package to facilitate connections to MySQL. However, with the advent of PHP 7, this package has been deprecated, leaving the responsibility of MySQL connectivity to the php-mysql package.

Installing the php-mysql Package

To enable MySQLi support in PHP 7, simply install the php-mysql package using the following command:

sudo apt-get install php-mysql

This command will automatically update Apache and PHP 7, ensuring that the MySQLi extension is functional. Once the installation is complete, restart Apache using:

sudo service apache2 restart

Verifying the Installation

After the restart, check the phpinfo() output to confirm the presence of the MySQLi extension. If enabled successfully, you should be able to access phpMyAdmin and utilize its features.

The above is the detailed content of How to Install the MySQLi Extension in PHP 7?. 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