Hosting Discussion

Hosting Discussion (https://www.hostingdiscussion.com/)
-   Web Hosting Discussion (https://www.hostingdiscussion.com/web-hosting-discussion/)
-   -   Why am I seeing a MySQL error on my Wordpress page? (https://www.hostingdiscussion.com/web-hosting-discussion/66659-why-am-i-seeing-mysql-error-my-wordpress-page.html)


LPTechs 03-08-2018 08:31 AM

Why am I seeing a MySQL error on my Wordpress page?
 
You happen to check your page one day and you see an error on your Wordpress site that says the following:


"Your PHP installation appears to be missing the MySQL extension which is required by WordPress"

There is 1 thing to check before searching all over the internet for a solution.

1. Contact your hosting provider and ask what the version is for the operating system of the server your account is on.

Why is this the only thing you need to check? I will tell you.

If the Shared Server your account is on has an operating system of 7 or higher, there is a code in your .htaccess file that is no longer needed and causes the error listed above.

"How do I fix this?"

One solution (and the most common solution) is to log into your file system (through cPanel, FTP, etc.) and look for a file called ".htaccess." The most common place for this file is in your public_html directory. In your .htaccess file, you want to look for this line of code:

suPHP_ConfigPath /home/[USERNAME]/public_html

You want to remove this code from the .htaccess file and then save it. Keep in mind there could be mutliple .htaccess files and multiple suPHP codes in those files; make sure to look for them all. Once the code is removed, the website should be showing again.

"Why can I not see my .htaccess file?"

Most file systems actually hide your dot files from you. There is a setting you should be able to turn on that allows you to see them.

easyhostmedia 03-08-2018 08:41 AM

Quote:

Originally Posted by LPTechs (Post 228440)
You happen to check your page one day and you see an error on your Wordpress site that says the following:


"Your PHP installation appears to be missing the MySQL extension which is required by WordPress"

There is 1 thing to check before searching all over the internet for a solution.

1. Contact your hosting provider and ask what the version is for the operating system of the server your account is on.

Why is this the only thing you need to check? I will tell you.

If the Shared Server your account is on has an operating system of 7 or higher, there is a code in your .htaccess file that is no longer needed and causes the error listed above.

"How do I fix this?"

One solution (and the most common solution) is to log into your file system (through cPanel, FTP, etc.) and look for a file called ".htaccess." The most common place for this file is in your public_html directory. In your .htaccess file, you want to look for this line of code:

suPHP_ConfigPath /home/[USERNAME]/public_html

You want to remove this code from the .htaccess file and then save it. Keep in mind there could be mutliple .htaccess files and multiple suPHP codes in those files; make sure to look for them all. Once the code is removed, the website should be showing again.

"Why can I not see my .htaccess file?"

Most file systems actually hide your dot files from you. There is a setting you should be able to turn on that allows you to see them.

that will only work if the server provider uses suPHP on the servers

webconfigure 03-12-2018 01:15 PM

The main reason for the error is incompatibility if your PHP version on the server and website configuration.

You should always check the supported PHP version on your server where you are going to host the website and the configuration supported by your website.

easyhostmedia 03-12-2018 01:45 PM

If you are using WHM/cPanel and have WHM version 60 + then in the sites cPanel under software you will have 'MultiPHP Manager' where you can change the PHP version for a particular website, so rather than change the servers PHP version to say PHP 7.0 and have clients complain some of their sites are messed up as they only work with PHP 5.6, clients can decided to change the PHP version that suits their website

webling 03-13-2018 06:20 PM

Quote:

Originally Posted by LPTechs (Post 228440)
You happen to check your page one day and you see an error on your Wordpress site that says the following:


"Your PHP installation appears to be missing the MySQL extension which is required by WordPress"

There is 1 thing to check before searching all over the internet for a solution.

1. Contact your hosting provider and ask what the version is for the operating system of the server your account is on.

Why is this the only thing you need to check? I will tell you.

If the Shared Server your account is on has an operating system of 7 or higher, there is a code in your .htaccess file that is no longer needed and causes the error listed above.

"How do I fix this?"

One solution (and the most common solution) is to log into your file system (through cPanel, FTP, etc.) and look for a file called ".htaccess." The most common place for this file is in your public_html directory. In your .htaccess file, you want to look for this line of code:

suPHP_ConfigPath /home/[USERNAME]/public_html

You want to remove this code from the .htaccess file and then save it. Keep in mind there could be mutliple .htaccess files and multiple suPHP codes in those files; make sure to look for them all. Once the code is removed, the website should be showing again.

"Why can I not see my .htaccess file?"

Most file systems actually hide your dot files from you. There is a setting you should be able to turn on that allows you to see them.


1. Connect via SSH and check the PHP version

To fix the problem, you should have SSH access to the server. Connect to your Linux VPS via SSH and check the PHP version which is currently in use:

php -v

2. Create Info.php file

You can also check the PHP version by creating a simple info.php file in your public_html directory with the following content:

<?php phpinfo(); ?>

Once you create the file, open your favorite web browser and access the file.

3. Update the required packages

If your are running an Ubuntu VPS and PHP 7, then run the following commands:

apt-get update
apt-get install php7.0-mysql

4. Restart the Web Server

Then restart your Apache service for the changes to take effect, or if you are using Nginx + PHP-FPM, then restart the PHP-FPM service.
5. Update PHP

In case you are running PHP 5, run the following commands:

apt-get update
apt-get install php-mysql

Restart the appropriate service for the changes to take effect.
6. Search all the available packages containing MySQL

To search all the available packages containing mysql, you can use this command:

apt-cache search mysql

On the other hand, if you are running a CentOS VPS and you have PHP 7 installed on the server, then run the following commands to fix the problem:

yum update
yum install php70w-mysql

7. Restart Apache

Restart Apache or the PHP-FPM service in case you are using Nginx + PHP-FPM as a web server.

If you have PHP 5 installed on your CentOS server, run the following commands:

yum update
yum install php-mysql

Restart the appropriate service for the changes to take effect.

To search all the available packages containing mysql, you can use the following command:

yum search mysql

Once you install the MySQL extension for PHP, you can return back to your WordPress setup. If the installation went OK, the message about the missing extension should not be presented to you. You can now continue with your WordPress setup.


All times are GMT -6. The time now is 04:28 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0