Home  >  Article  >  Database  >  How to Fix the \"Missing MySQL PHP Extension\" Error?

How to Fix the \"Missing MySQL PHP Extension\" Error?

Linda Hamilton
Linda HamiltonOriginal
2024-11-04 02:12:01680browse

How to Fix the

Resolving the "Missing MySQL PHP Extension" Error

When installing WordPress or other PHP applications requiring MySQL, users may encounter an error indicating that the MySQL PHP extension is missing. This article addresses this issue, providing a step-by-step guide to resolving it.

Verifying MySQL Installation

The first step is to ensure MySQL server is running. Execute the following command in a shell prompt:

/etc/init.d/mysql status

If MySQL is not running, start it using:

/etc/init.d/mysql start

If it's not installed, install it with:

apt-get install mysql-server

Installing PHP MySQL Module

Next, install the PHP MySQL module using:

dpkg --list | grep php5-mysql

To install the module, run:

apt-get install php5-mysql

Restarting Apache

Finally, restart the Apache web server to make the changes effective:

/etc/init.d/apache2 restart

These steps should resolve the "Missing MySQL PHP Extension" error, allowing you to continue with your PHP application installation.

The above is the detailed content of How to Fix the \"Missing MySQL PHP Extension\" Error?. 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