Home > Database > Mysql Tutorial > How to Fix PHP Error: \'Your PHP installation appears to be missing the MySQL extension which is required by WordPress\'?

How to Fix PHP Error: \'Your PHP installation appears to be missing the MySQL extension which is required by WordPress\'?

DDD
Release: 2024-11-04 04:33:02
Original
1050 people have browsed it

How to Fix PHP Error:

PHP Error: Missing MySQL Extension for WordPress

When attempting to install WordPress, you may encounter the error "Your PHP installation appears to be missing the MySQL extension which is required by WordPress." This error indicates that the PHP extension for accessing MySQL is not enabled or configured correctly. Here's how to resolve this issue:

  1. Verify MySQL Installation and Status:

    • Ensure that the MySQL server is running by running /etc/init.d/mysql status. If not, start it using /etc/init.d/mysql start.
    • If MySQL is not installed, use apt-get install mysql-server to install it.
  2. Install PHP MySQL Extension:

    • Check if the PHP MySQL module for PHP5 is installed using dpkg --list | grep php5-mysql.
    • If not, install it with apt-get install php5-mysql.
  3. Confirm Extension Installation:

    • Run phpinfo() within your PHP code to verify that the MySQLi module is activated. It should be listed under the "Loaded Extensions" section. If not, check your php.ini file (typically located at /etc/php/php.ini) and uncomment the extension=mysqli.so line.
  4. Restart Web Server:

    • Once the MySQL extension is installed and configured, restart your web server (e.g., Apache2) using /etc/init.d/apache2 restart.
  5. Address MySQL Shortcut Issue (Zyxel NSA310 Specific):

    • Note that this issue is specific to Zyxel NSA310 devices. When mysqld is started, it creates a shortcut from the root to /ffp/opt/mysql which is deleted upon NAS restarts. To address this, it is recommended to create a symbolic link instead:

      • Run ln -s /ffp/opt/mysql /root/mysql

The above is the detailed content of How to Fix PHP Error: \'Your PHP installation appears to be missing the MySQL extension which is required by WordPress\'?. 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