{"id":4699,"date":"2013-05-26T01:06:27","date_gmt":"2013-05-25T17:06:27","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=4699"},"modified":"2023-06-23T13:12:55","modified_gmt":"2023-06-23T13:12:55","slug":"how-to-fix-your-php-installation-appears-to-be-missing-the-mysql-extension-which-is-required-by-wordpress","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-fix-your-php-installation-appears-to-be-missing-the-mysql-extension-which-is-required-by-wordpress\/","title":{"rendered":"How to Fix &#8220;Your PHP installation appears to be missing the MySQL extension which is required by WordPress&#8221;"},"content":{"rendered":"<p>WordPress is a popular content management system that requires PHP and MySQL to function. However, sometimes you may encounter an error message that says &#8220;Your PHP installation appears to be missing the MySQL extension which is required by WordPress&#8221;. This error occurs when the PHP installation on your server is missing the MySQL extension, which is required by WordPress to connect to the MySQL database.<\/p>\n<p>In this guide, we will show you how to fix this error.<\/p>\n<h2>Step 1: Check if the MySQL extension is installed<\/h2>\n<p>The first step is to check if the MySQL extension is installed on your server. You can create a PHP file with the following code to check:<\/p>\n<pre>\r\n&lt;?php\r\nphpinfo();\r\n?&gt;\r\n<\/pre>\n<p>Save the file and upload it to your server. Then, open the file in your web browser and search for &#8220;MySQLi&#8221;. If it is not present, then the MySQL extension is not installed on your server.<\/p>\n<h2>Step 2: Install the MySQL extension<\/h2>\n<p>To install the MySQL extension, you need to log in to your server as root or a user with sudo privileges. Then, run the following command:<\/p>\n<pre>\r\nsudo apt-get install php-mysql\r\n<\/pre>\n<p>This command will install the MySQL extension for PHP on your server.<\/p>\n<pre>\r\nLoaded plugins: fastestmirror\r\nLoading mirror speeds from cached hostfile\r\n * base: mirror.upsi.edu.my\r\n * epel: ftp.cuhk.edu.hk\r\n * extras: mirror.upsi.edu.my\r\n * updates: mirror.upsi.edu.my\r\nSetting up Install Process\r\nResolving Dependencies\r\n--> Running transaction check\r\n---> Package php-mysql.x86_64 0:5.3.3-22.el6 will be installed\r\n--> Processing Dependency: php-pdo(x86-64) for package: php-mysql-5.3.3-22.el6.x86_64\r\n--> Running transaction check\r\n---> Package php-pdo.x86_64 0:5.3.3-22.el6 will be installed\r\n--> Finished Dependency Resolution\r\n\r\nDependencies Resolved\r\n\r\n====================================================================================================\r\n Package                 Arch                 Version                      Repository          Size\r\n====================================================================================================\r\nInstalling:\r\n php-mysql               x86_64               5.3.3-22.el6                 base                81 k\r\nInstalling for dependencies:\r\n php-pdo                 x86_64               5.3.3-22.el6                 base                75 k\r\n\r\nTransaction Summary\r\n====================================================================================================\r\nInstall       2 Package(s)\r\n\r\nTotal download size: 155 k\r\nInstalled size: 383 k\r\nIs this ok [y\/N]: y\r\nDownloading Packages:\r\n(1\/2): php-mysql-5.3.3-22.el6.x86_64.rpm                                     |  81 kB     00:00\r\n(2\/2): php-pdo-5.3.3-22.el6.x86_64.rpm                                       |  75 kB     00:00\r\n----------------------------------------------------------------------------------------------------\r\nTotal                                                               137 kB\/s | 155 kB     00:01\r\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\n  Installing : php-pdo-5.3.3-22.el6.x86_64                                                      1\/2\r\n  Installing : php-mysql-5.3.3-22.el6.x86_64                                                    2\/2\r\n  Verifying  : php-pdo-5.3.3-22.el6.x86_64                                                      1\/2\r\n  Verifying  : php-mysql-5.3.3-22.el6.x86_64                                                    2\/2\r\n\r\nInstalled:\r\n  php-mysql.x86_64 0:5.3.3-22.el6\r\n\r\nDependency Installed:\r\n  php-pdo.x86_64 0:5.3.3-22.el6\r\n\r\nComplete!\r\n<\/pre>\n<h2>Step 3: Restart the System<\/h2>\n<p>After the installation is complete, restart your web server to apply the changes:<\/p>\n<pre>\r\nsudo systemctl restart apache2\r\n<\/pre>\n<h2>Step 4: Test<\/h2>\n<p>To test if the MySQL extension has been installed and the error has been resolved, navigate to your WordPress site and refresh the page. If the error message no longer appears, then the issue has been resolved.<\/p>\n<h2>Commands Mentioned:<\/h2>\n<ul>\n<li><span class=\"fw-bold\">phpinfo()<\/span> &#8211; displays PHP configuration information<\/li>\n<li><span class=\"fw-bold\">sudo apt-get install php-mysql<\/span> &#8211; installs the MySQL extension for PHP on Ubuntu or Debian-based systems<\/li>\n<li><span class=\"fw-bold\">sudo systemctl restart apache2<\/span> &#8211; restarts the Apache web server<\/li>\n<\/ul>\n<h2>Conclusion:<\/h2>\n<p>In this guide, we have shown you how to fix the &#8220;Your PHP installation appears to be missing the MySQL extension which is required by WordPress&#8221; error. By checking if the MySQL extension is installed, installing it if necessary, and testing your WordPress site, you can resolve this error and ensure that your WordPress site is functioning correctly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress is a popular content management system that requires PHP and MySQL to function. However, sometimes you may encounter an error message that says &#8220;Your PHP installation appears to be&#8230;<\/p>\n","protected":false},"author":6,"featured_media":1262,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1025],"tags":[1244,1585,1646,1933],"class_list":["post-4699","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-centos","tag-mysql","tag-php","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=4699"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4699\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/1262"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=4699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=4699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=4699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}