Fixing the "Missing MySQL Extension" Error for WordPress with PHP
WordPress installation requires the MySQL extension for PHP to function correctly. If you encounter the error message "Your PHP installation appears to be missing the MySQL extension," you can follow these steps to resolve it:
Verify MySQL Server Status:
Run the command /etc/init.d/mysql status to check if the MySQL server is running. If it's not, start it using /etc/init.d/mysql start. If MySQL is not installed, use apt-get install mysql-server to install it.
Check for PHP MySQL Module:
Run dpkg --list | grep php5-mysql to verify if the PHP MySQL module (php5-mysql) is installed. If it's not, install it with apt-get install php5-mysql.
Enable PHP MySQL Extension:
Edit the php.ini file (ffp/etc/php.ini) and uncomment the following extensions:
Restart Web Server:
Run /etc/init.d/apache2 restart to restart the web server and apply the changes.
Additional Tip:
If you encounter issues with shortcuts being deleted after MySQL restarts, consider creating a symlink in your root directory to ffp/opt/mysql. Use the command sudo ln -s ffp/opt/mysql /root.
By following these steps, you should resolve the missing MySQL extension issue and get WordPress running smoothly.
The above is the detailed content of How to Fix the \'Missing MySQL Extension\' Error in WordPress?. For more information, please follow other related articles on the PHP Chinese website!