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

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

DDD
DDDOriginal
2024-12-10 12:29:16645browse

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

Resolving MySQLi Extension Absence in PHP 7 on Ubuntu

To enable MySQLi functionality in PHP 7, it's necessary to address an issue caused by the deprecation of the "php5-mysql" package. Here are the steps to resolve this issue:

  1. Uninstall the Deprecated Package:

    sudo apt-get remove php5-mysql
  2. Install the New Package:

    sudo apt-get install php-mysql

    This command installs the new package responsible for connecting PHP to MySQL.

  3. Restart Apache:

    sudo service apache2 restart
  4. Confirm Installation:

    To verify that MySQLi is now enabled, use the phpinfo() function in your PHP code. It should display the MySQLi extension under the "Loaded Extensions" section.

Additional Note:

If you are using phpMyAdmin, you may have encountered an error message indicating that the MySQLi extension is missing. By following these steps, you will resolve this issue and be able to use phpMyAdmin without encountering any errors.

The above is the detailed content of How Do I Fix the Missing MySQLi Extension in PHP 7 on Ubuntu?. 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