Get Paid to Participate - up to $1 per post!     Twitter     Facebook
Hosting Discussion
 

Hosting Discussion > Web Hosting Forums > Web Hosting Discussion > Why am I seeing a MySQL error on my Wordpress page?
forgot password?



FORUM SUPPORTERS:

Reply


Old
  Post #1 (permalink)   03-08-2018, 08:31 AM
HD Newbie
 
Join Date: Feb 2018
Posts: 13

Status: LPTechs is offline
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.
__________________
LP TECHS
www.lunarpages.com

 
 


Old
  Post #2 (permalink)   03-08-2018, 08:41 AM
HD Wizard
 
easyhostmedia's Avatar
 
Join Date: Mar 2011
Location: Northumberland, UK
Posts: 5,533
Send a message via MSN to easyhostmedia

Status: easyhostmedia is offline
Quote:
Originally Posted by LPTechs View Post
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
__________________
Terry Robertson - CEO The Easyhost Media Group
PowerSSL - - We Secure your World
The Scamlist Forum - Fighting against scammers
 
 
 


Old
  Post #3 (permalink)   03-12-2018, 01:15 PM
HD Amateur
 
Join Date: Jan 2018
Location: India
Posts: 96
Send a message via Skype™ to webconfigure

Status: webconfigure is offline
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.
 
 
 


Old
  Post #4 (permalink)   03-12-2018, 01:45 PM
HD Wizard
 
easyhostmedia's Avatar
 
Join Date: Mar 2011
Location: Northumberland, UK
Posts: 5,533
Send a message via MSN to easyhostmedia

Status: easyhostmedia is offline
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
__________________
Terry Robertson - CEO The Easyhost Media Group
PowerSSL - - We Secure your World
The Scamlist Forum - Fighting against scammers
 
 
 


Old
  Post #5 (permalink)   03-13-2018, 06:20 PM
HD Master
 
webling's Avatar
 
Join Date: Dec 2010
Posts: 261

Status: webling is offline
Quote:
Originally Posted by LPTechs View Post
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.
__________________
Chosen Web Host Quality Shared web hosting and Design
Integrity with Excellence - Free backups through cPanel
You can't develop the internet, until you learn to develop yourself
 
 
Reply

Thread Tools

New Post New Post   Old Post Old Post
Posting Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Sponsored By: