SMF Site down fatal error v2.0.11

Started by stipchaser, November 03, 2019, 12:34:43 PM

Previous topic - Next topic

stipchaser


Hi all its been a while and I regret to say I am stuck. We are resurrecting our simple machines forums ver 2.0.11. with a newly registered domain name. Which by the way was working fine until our domain name expired. The files have been sitting on NFO servers because we have other services that are active and the web hosting comes with the deal. The database was a InnoDB schema and when I went to check on them on NFO I noticed a new message.

"When creating tables in a database, we strongly recommend against using InnoDB, because it is not good with recovering from crashes and we can't individually restore InnoDB tables from our backups." lol!

This is the error:

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /usr/www/ugzdedi1/public/Forums/Sources/Subs-Db-mysql.php:58 Stack trace: #0 /usr/www/ugzdedi1/public/Forums/Sources/Load.php(2594): smf_db_initiate('localhost', 'ugzdedi1_smf', 'ugzdedi1', 'xxxxxxx', 'ugz_', Array) #1 /usr/www/ugzdedi1/public/Forums/index.php(69): loadDatabase() #2 {main} thrown in /usr/www/ugzdedi1/public/Forums/Sources/Subs-Db-mysql.php on line 58

I can access my databases with phpmyadmin but not sure how to convert from InnoDB or if I even need to. I cannot connect to repair_settings.php I get the same error as above. I am not sure why ugz is up there by the password or if it should say smf? I cannot access the site so any help would be greatly appreciated. I can assure you this post does not come with lack of effort trying to resolve this issue.

Arantor

Your host has upgraded you to PHP 7.0 without letting you know in advance. The only way to fix this is either to get them to downgrade you to PHP 5.6 and then for you to upgrade to SMF 2.0.15 - you're on SMF 2.0.11 which does not work on PHP 7.0. The other option is a brute force upgrade to SMF 2.0.15 but this will remove most mods you have in the process.

Also... if your host says that InnoDB is a bad idea, that suggests they don't know what they're talking about; InnoDB has been more reliable for years than MyISAM.

Aleksi "Lex" Kilpinen

mysql_connect doesn't work on PHP 7, so if you want to get the forum running immediately - your best bet is to switch to PHP 5.6 if it is available for you.
Then, you should update SMF - this problem, among others, have been fixed in later versions, and SMF should be ok with versions up to PHP 7.1.

And - Arantor was faster :)
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

GigaWatt

What about installed mods? Some of them might be outdated and not work with PHP 7.x. You should also check this or post a list of the mods that your forum is using so that we might check and see if any mods need updating or if they're abandoned by their authors (in which case, if you're switching to 7.x, you'd have to ditch those mods or find equivalent ones that work on PHP 7.x).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

stipchaser

Yes understood and thank you all for the prompt replies. I have put in the request but was considering perhaps putting up a test environment on a server I have. The only problem is its a Windows server so I would have to install/setup a CentOS environment to duplicate our existing one and perhaps set it up with PHP 5.6 and do the upgrade from there. At any rate the work for sure builds character and it would not hurt to sharpen my skill set in this area again. Thanks again and Arantor its good to see you back bro I'm sure everyone would agree your efforts, time and contribution here are and always will be highly respected, admired among all the members that have been here since back in the day. Thank you.

stipchaser


I am reaching here but do you think this could possibly work?


"Call to undefined function mysql_connect()" error on PHP 7
Post by Vanderburg » Fri Sep 08, 2017 11:40 am

If you're receiving the following error:


CODE: SELECT ALL
Uncaught Error: Call to undefined function mysql_connect() in /usr/www/identifier/public/forums/functions/db.php:324


...this is due to the deprecated mysql extension no longer being included, breaking all "mysql_" functions. Ideally, you should update or convert your software to use mysqli or PDO, but if those aren't options in the short term, you might try applying a shim that recreates the functions.


1. Download the shim here: https://raw.githubusercontent.com/dshaf ... /mysql.php
2. Upload the mysql.php file to your webhosting. Place it in the includes folder for your website, or a directory where typical config files can be found, if available
3. Locate a common file that is that is included everywhere in your software. Often this file is called "config.php" or "Settings.php" or similar. Edit that file to add this before other PHP statements:


CODE: SELECT ALL
include_once('./mysql.php');


a. This assumes the shim is in the same directory as the config file. If it's one directory up, you'll use '../mysql.php' and if it's one directory down, you'll use './folder_name/mysql.php'.
b. If you do not have a common config file, the line above will need to be included in all files using MySQL

Arantor

As a temporary measure until you can upgrade that might work. You will have other problems if you try to run the forum just on that, but that should be enough to get you to 2.0.15.

GigaWatt

Quote from: stipchaser on November 05, 2019, 05:52:25 PM
1. Download the shim here: https://raw.githubusercontent.com/dshaf ... /mysql.php

The URL isn't correct... something went wrong with copy/paste :P :D.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Illori


Arantor

If you take that file, save it somewhere then include it from Settings.php, it will fix the missing mysql_connect functions etc. This would allow for upgrading to 2.0.15.

Advertisement: