website down

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
IceCold2
New to forums
New to forums
Posts: 6
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Fri Sep 01, 2017 1:54 pm

website down

Post by IceCold2 »

my website is down, since NFO changed to PHP 7
how do I fix this ?
User avatar
Vanderburg
Former staff
Former staff
Posts: 1253
Joined: Sat Nov 13, 2010 7:27 am
Location: Dallas, TX

Re: website down

Post by Vanderburg »

What is the specific error you are receiving? As much details as possible is helpful.
IceCold2
New to forums
New to forums
Posts: 6
Joined: Fri Sep 01, 2017 1:54 pm

Re: website down

Post by IceCold2 »

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /usr/www/plplatoon/public/wp-config.php:40 Stack trace: #0 /usr/www/plplatoon/public/wp-load.php(37): require_once() #1 /usr/www/plplatoon/public/wp-blog-header.php(13): require_once('/usr/www/plplat...') #2 /usr/www/plplatoon/public/index.php(17): require('/usr/www/plplat...') #3 {main} thrown in /usr/www/plplatoon/public/wp-config.php on line 40

website has wordpress installed, also it is up to date.
User avatar
Vanderburg
Former staff
Former staff
Posts: 1253
Joined: Sat Nov 13, 2010 7:27 am
Location: Dallas, TX

Re: website down

Post by Vanderburg »

"mysql" functions were removed in PHP 7. You should make sure Wordpress is using the mysqli extension, by making sure the file wp-includes/wp-db.php has the following:

Code: Select all

private $use_mysqli = true;
IceCold2
New to forums
New to forums
Posts: 6
Joined: Fri Sep 01, 2017 1:54 pm

Re: website down

Post by IceCold2 »

changed that , but same error :-

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /usr/www/plplatoon/public/wp-config.php:40 Stack trace: #0 /usr/www/plplatoon/public/wp-load.php(37): require_once() #1 /usr/www/plplatoon/public/wp-blog-header.php(13): require_once('/usr/www/plplat...') #2 /usr/www/plplatoon/public/index.php(17): require('/usr/www/plplat...') #3 {main} thrown in /usr/www/plplatoon/public/wp-config.php on line 40
IceCold2
New to forums
New to forums
Posts: 6
Joined: Fri Sep 01, 2017 1:54 pm

Re: website down

Post by IceCold2 »

fixed !

you must change wp-config.php line:-

mysql_connect(DB_HOST , DB_USER , DB_PASSWORD) or die(mysql_error());

to

mysqli_connect(DB_HOST , DB_USER , DB_PASSWORD,DB_NAME) or die(mysql_error());

also, you may get errors with plugins.
just change the plugin directory name, to stop plugin loading.
User avatar
Vanderburg
Former staff
Former staff
Posts: 1253
Joined: Sat Nov 13, 2010 7:27 am
Location: Dallas, TX

Re: website down

Post by Vanderburg »

Odd that they'd have the variable but that it wouldn't work and that manually changing the function works instead. I'm glad you got it worked out, though!
User avatar
Edge100x
Founder
Founder
Posts: 12945
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: website down

Post by Edge100x »

Make sure to update to the latest version! It should use mysqli by default.

Running an old version of Wordpress usually presents many security risks.
IceCold2
New to forums
New to forums
Posts: 6
Joined: Fri Sep 01, 2017 1:54 pm

Re: website down

Post by IceCold2 »

i allway keep wp updated
latest version 4.8.1
doulos9
This is my homepage
This is my homepage
Posts: 200
Joined: Sun Sep 15, 2013 9:44 pm

Re: website down

Post by doulos9 »

Maybe WP does not update your config file.
Post Reply