Sources/Subs-Db-mysql.php on line 58

Started by Pawan, May 05, 2020, 09:08:11 AM

Previous topic - Next topic

Pawan

I am getting below error while opening the website. Same for repair_settings.

SMF version: 2.X

Fatal error:
Uncaught Error: Call to undefined function mysql_connect() in /home3/XXXXXXX/mbathesis.in/Sources/Subs-Db-mysql.php:58
Stack trace: #0 /home3/XXXXXXX/mbathesis.in/Sources/Load.php(2576): smf_db_initiate('localhost', 'XXXXXXX', 'XXXXXXX', 'XXXXXXX', 'smf_', Array)
#1 /home3/XXXXXXX/mbathesis.in/index.php(77): loadDatabase() #2 {main} thrown in /home3/XXXXXXX/mbathesis.in/Sources/Subs-Db-mysql.php on line 58


Line 58 of that file is for connection. As of now, I have moved the site to "Maintenance Mode" through settings.php

      $connection = @mysql_connect($db_server, $db_user, $db_passwd);

Also, this error show username and password of DB. isn't that a flaw?

Please advice, I have not done any changes. Just found while doing a random check

Shambles

QuoteSMF version: 2.X

What version is that, exactly?

And what version of PHP are you running on?

Kindred

also, 2.x is not a version...

what SPECIFIC version of SMF are you using?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

vbgamer45

Good point on the stack trace if the function is not defined.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Pawan

Quote from: Shambles on May 05, 2020, 09:42:36 AM
QuoteSMF version: 2.X

What version is that, exactly?

And what version of PHP are you running on?
Quote from: Kindred on May 05, 2020, 09:43:54 AM
also, 2.x is not a version...

what SPECIFIC version of SMF are you using?

Using SMF 2.0.13 as per Wayback machine. Can I know which file to check to get the exact version?

Hosting is showing "You're currently configured to use PHP 7.1", but when I click on the website directory it is showing 5.4 as default. Though I have already tried setting it to 7.1 and I got the same error.

vbgamer45

The index.php file will tell you the SMF version if you scroll down to SMF_VERSION
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Pawan

Quote from: vbgamer45 on May 05, 2020, 10:51:33 AM
The index.php file will tell you the SMF version if you scroll down to SMF_VERSION

$forum_version = 'SMF 2.0.13';

What can be done to fix this issue? This is strange, it was working without any issue for a while.

vbgamer45

Your host probably upgraded PHP and that casued this to occur.
Either rollback PHP version or update SMF to the new files.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

shawnb61

It appears your php was upgraded.  Change your php setting back to somewhere in the 5.4-5.6 range to get back up & running. 

Then upgrade to smf 2.0.17.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Pawan

Quote from: vbgamer45 on May 05, 2020, 11:52:20 AM
Your host probably upgraded PHP and that casued this to occur.
Either rollback PHP version or update SMF to the new files.

Quote from: shawnb61 on May 05, 2020, 11:53:53 AM
It appears your php was upgraded.  Change your php setting back to somewhere in the 5.4-5.6 range to get back up & running. 

Then upgrade to smf 2.0.17.
I will try to manually update the SMF version and see. Time to search the forum for the manual update procedure.

Thanks all for your help. I will update here if I am able to fix this.

shawnb61

By far, the easiest way is to apply the patches one at a time, 2.0.14-2.0.17.  To do that, the forum needs to be up & running, which would require php 5.4-5.6.  This is the suggested route.  Upgrade PHP once you're done.

If your host refuses access to php5x for some reason, you can reload the files, but this means you lose all customizations.  If your forum was 100% vanilla, no problem.  If not, it can be a lot of work...
https://wiki.simplemachines.org/smf/How_to_upload_a_fresh_set_of_files
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Pawan

Quote from: shawnb61 on May 05, 2020, 12:41:15 PM
By far, the easiest way is to apply the patches one at a time, 2.0.14-2.0.17.  To do that, the forum needs to be up & running, which would require php 5.4-5.6.  This is the suggested route.  Upgrade PHP once you're done.

If your host refuses access to php5x for some reason, you can reload the files, but this means you lose all customizations.  If your forum was 100% vanilla, no problem.  If not, it can be a lot of work...
https://wiki.simplemachines.org/smf/How_to_upload_a_fresh_set_of_files

Thanks for the tip. But, I am not able to login to forum. Will try to upload fresh file and see if that works.

shawnb61

Quote from: Pawan on May 05, 2020, 04:43:23 PM
Thanks for the tip. But, I am not able to login to forum. Will try to upload fresh file and see if that works.

Pretty sure that going back to php 5.4-5.6 will allow you to log back on.  The assumption here is the only change that got you kicked out was that the host upgraded you to php7.x.

It should be pretty simple for you or your host to point you back to php5.

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Pawan

My site has been back after reverting the PHP version to 5.6. Now I will upgrade the SMF version.

Thanks everyone!

Pawan

I was able to update to 2.0.17, but when I again move to PHP 7.2 by adding the below code to htaccess file. I am getting the same error.
The hosting company has asked to put that code for PHP 7.2. They have also added code for PHP 5.6 which I replaced with this new one.

# PHP 7.2
<IfModule mime_module>
AddHandler application/x-httpd-ea-php72 .php .php5 .phtml
</IfModule>


As of now, the site is working as I have moved back to PHP 5.6 again.

SpacePhoenix


Pawan

Quote from: SpacePhoenix on May 05, 2020, 08:23:27 PM
All mods up to date?

Under "Modification Packages", none is showing as "older version "

Advertisement: