Home > Database > Mysql Tutorial > How Do I Enable the MySQLi Extension in PHP 7 on Ubuntu?

How Do I Enable the MySQLi Extension in PHP 7 on Ubuntu?

DDD
Release: 2024-12-14 12:56:10
Original
102 people have browsed it

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
Copy after login

This action automatically updates Apache and PHP 7, installing the MySQLi extension.

Restart Apache to complete the installation:

sudo service apache2 restart
Copy after login

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!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template