Simple Machines Community Forum

SMF Support => Server Performance and Configuration => Topic started by: lord alibaski on February 17, 2023, 12:41:47 PM

Title: smf and wampserver
Post by: lord alibaski on February 17, 2023, 12:41:47 PM
I forgot how to do this now, but how do you point smf install to an imported database.

Thanks for any help.

Title: Re: smf and wampserver
Post by: vbgamer45 on February 17, 2023, 12:50:46 PM
You just update the database settings in your Settings.php in your forum. You can also use the repair settings tool.
Title: Re: smf and wampserver
Post by: lord alibaski on February 17, 2023, 01:12:25 PM
So I've uploaded the sql file to phpmyadmin

Then opened up localhost that goes to SMF Installer, where you get these settings

(https://i.postimg.cc/fyb52yBh/Screenshot-2023-02-17-180014.png)

All you can do here is put username as root it goes nowhere. I carry on with the installation and it creates a database of it's own, but I am sure I pointed it towards the uploaded database on installation last time.

I don't know how to do it exactly because I just tried it via repair settings and now I get this

Connection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.

I know it's being cheeky vbgamer45 but can you just go through it on how to do it from a fresh install and then adding it to an uploaded database on wampserver.
Title: Re: smf and wampserver
Post by: vbgamer45 on February 17, 2023, 01:16:38 PM
Well what you could do is install SMF to a database.
Then delete the contents of the database and replace with your sql file that you saved in the same database.

Title: Re: smf and wampserver
Post by: lord alibaski on February 17, 2023, 03:00:19 PM
Thought I had it working then used repair settings saved it and then this popped up

(https://i.postimg.cc/sD7fVCS5/Screenshot-2023-02-17-195913.png)

any idea what that could be?

Title: Re: smf and wampserver
Post by: vbgamer45 on February 17, 2023, 03:39:43 PM
Check your database the smf_settings table exists.

Or do your smf tables star with ad different prefix other than smf_

If so you need to adjust that in Settings.php
Title: Re: smf and wampserver
Post by: lord alibaski on February 18, 2023, 04:30:04 PM
Cant get anywhere with this, I have added what I think is right inside settings.php, the smf_settings is inside the table but no matter what I try it keeps coming back with the same error as above.

I have uploaded the settings.php can you have a look at this and add where I should be putting the relevant information. I will give this one last go if it works after that I'm done trying lol
Title: Re: smf and wampserver
Post by: vbgamer45 on February 18, 2023, 04:49:03 PM
Your database prefix should be smf_
Title: Re: smf and wampserver
Post by: lord alibaski on February 18, 2023, 05:10:14 PM
Changed it and still same error, give up with it something must have changed in this version of wampserver I have never had a problem like this before.
Title: Re: smf and wampserver
Post by: lord alibaski on February 21, 2023, 05:08:08 PM
I thought I cracked it but after using repair settings I get this error now.

( ! ) Warning: Undefined array key "load_average" in C:\wamp64\www\Sources\Load.php on line 382
Call Stack
# Time Memory Function Location
1 0.0003 364224 {main}( ) ...\index.php:0
2 0.0136 386248 reloadSettings( ) ...\index.php:142

( ! ) Warning: Undefined array key "load_average" in C:\wamp64\www\Sources\Load.php on line 386
Call Stack
# Time Memory Function Location
1 0.0003 364224 {main}( ) ...\index.php:0
2 0.0136 386248 reloadSettings( ) ...\index.php:142
C:\wamp64\www\Sources\Errors.php:50:
array (size=5)
  0 =>
    array (size=3)
      'file' => string 'C:\wamp64\www\Sources\Subs.php' (length=30)
      'line' => int 6063
      'function' => string 'log_error' (length=9)
  1 =>
    array (size=3)
      'file' => string 'C:\wamp64\www\Sources\Subs.php' (length=30)
      'line' => int 5944
      'function' => string 'load_file' (length=9)
  2 =>
    array (size=3)
      'file' => string 'C:\wamp64\www\Sources\Subs.php' (length=30)
      'line' => int 5762
      'function' => string 'call_helper' (length=11)
  3 =>
    array (size=3)
      'file' => string 'C:\wamp64\www\Sources\Load.php' (length=30)
      'line' => int 526
      'function' => string 'call_integration_hook' (length=21)
  4 =>
    array (size=3)
      'file' => string 'C:\wamp64\www\index.php' (length=23)
      'line' => int 142
      'function' => string 'reloadSettings' (length=14)
Error loop.
Title: Re: smf and wampserver
Post by: dodos26 on February 23, 2023, 09:25:47 AM
Oddly enough, I don't have these problems with 3.3.0 x64
appache 2.4.54.2
phpmyadmin 5.2.0
php 7.4.33
mysql 8.0.31
Title: Re: smf and wampserver
Post by: vbgamer45 on February 23, 2023, 09:50:53 AM
PHP 8.0+ adds more warnings for PHP issues. Might be a bug with smf. load_average is part of windows servers to that might be why
Title: Re: smf and wampserver
Post by: lord alibaski on February 23, 2023, 08:20:40 PM
Tried all versions of PHP and same error occurs.
Title: Re: smf and wampserver
Post by: vbgamer45 on February 25, 2023, 07:30:38 AM
Insert a setting into the smf_settings database table called load_average
no value needed.
Title: Re: smf and wampserver
Post by: lord alibaski on February 26, 2023, 02:19:44 PM
Hi vbgamer45

You don't mind if I message you regarding this do you? just that I don't want to post my smf_settings in here.
Title: Re: smf and wampserver
Post by: vbgamer45 on February 26, 2023, 02:32:39 PM
You shouldn't have to post the table just insert the new database row and should be set.
Title: Re: smf and wampserver
Post by: lord alibaski on February 26, 2023, 02:43:19 PM
This is what I mean I don't know if it's actually set because if I look inside the table it doesn't seem to be there but if I try to insert it again it tells me it's already there!!

(https://i.postimg.cc/5NFM8b95/1.png)

(https://i.postimg.cc/Pq1WDL0G/2.png)

Just don't know if I am entering it correctly.
Title: Re: smf and wampserver
Post by: vbgamer45 on February 26, 2023, 02:50:39 PM
Out of ideas then might be a bug with SMF.
Title: Re: smf and wampserver
Post by: lord alibaski on February 26, 2023, 02:59:39 PM
No worries about it vbgamer45 I'm out of idea's as well I just wanted to see if I could get the old database up using wamp. I didn't want to upload it to my server and try it on there using an older database.

It also must be a bug inside wamp because last time I did this it worked without any problems at all, it was a straight upload of the sql file and pointed the install to it and it worked without any issues.
Title: Re: smf and wampserver
Post by: Illori on February 26, 2023, 03:02:01 PM
did you run repair_settings.php at any point? if not i would suggest and try again.

What is repair_settings.php? (https://wiki.simplemachines.org/smf/Repair_settings.php)
Title: Re: smf and wampserver
Post by: lord alibaski on February 26, 2023, 03:10:57 PM
Hi Illori

Yeah I have run repair_settings everytime it's nothing to worry about.
Title: Re: smf and wampserver
Post by: vbgamer45 on February 26, 2023, 03:43:04 PM
Does the site run? If so maybe just comment out those. Or adjust your error display/logging settings in your php.ini
Title: Re: smf and wampserver
Post by: Arantor on February 26, 2023, 04:14:37 PM
You're only looking at the first page; there's a good few hundred items in a normal smf_settings table - scroll down a couple of pages, see what the item says.
Title: Re: smf and wampserver
Post by: lord alibaski on February 26, 2023, 06:40:09 PM
Quote from: vbgamer45 on February 26, 2023, 03:43:04 PMDoes the site run? If so maybe just comment out those. Or adjust your error display/logging settings in your php.ini

My main site is working fine, just that I had to change hosting and domain hosting a couple of weeks ago. When my domain name completed propagation for some strange reason my forum went back a week this losing a few important post. Though before it happened I downloaded a database from 14-02-23 but when I uploaded it to the server the forum went back even further, like to the middle of 2022!! I wanted to test this database I downloaded on the 14th to see what had happened so I have been trying to get it working on wampserver but with no luck.


Quote from: Arantor on February 26, 2023, 04:14:37 PMYou're only looking at the first page; there's a good few hundred items in a normal smf_settings table - scroll down a couple of pages, see what the item says.

I only just noticed this Arantor having looking at it again I didn't see the drop down menu and it was inputted on page 13, but like I said I don't know if I have inserted it correctly.

This is how it looks

Title: Re: smf and wampserver
Post by: vbgamer45 on February 26, 2023, 06:45:41 PM
I run on wamp too for most of my sites. I don't use premade apache/php packages. I grab mine from apachelougne.com and php from windows.php.net and then set them up directly. Running most PHP 8.0 and have one server left on 7.4
Title: Re: smf and wampserver
Post by: Arantor on February 26, 2023, 07:18:12 PM
No, "no value needed" is not what it's after, it should just be blank.
Title: Re: smf and wampserver
Post by: shawnb61 on February 26, 2023, 08:00:20 PM
My initial suspicion here is that you have load averaging enabled on your production server...  But it's not supported on Windows, so the system may be getting confused with unix settings restored on a wamp server.

Do you have a value in the settings table for 'loadavg_enable'?

If so, I'd just plain delete that.  It shouldn't even be looking at 'load_average'...
Title: Re: smf and wampserver
Post by: lord alibaski on February 26, 2023, 08:05:36 PM
I've just deleted the load_average table, did a search for loadavg_enable and the value is set to 1

Just used repair settings again removed it and still gettin these errors

( ! ) Warning: Undefined array key "load_average" in C:\wamp64\www\Sources\Load.php on line 382
Call Stack
#   Time   Memory   Function   Location
1   0.0014   364904   {main}( )   ...\index.php:0
2   0.0091   386480   reloadSettings( )   ...\index.php:142

( ! ) Warning: Undefined array key "load_average" in C:\wamp64\www\Sources\Load.php on line 386
Call Stack
#   Time   Memory   Function   Location
1   0.0014   364904   {main}( )   ...\index.php:0
2   0.0091   386480   reloadSettings( )   ...\index.php:142
C:\wamp64\www\Sources\Errors.php:50:
array (size=5)
  0 =>
    array (size=3)
      'file' => string 'C:\wamp64\www\Sources\Subs.php' (length=30)
      'line' => int 6063
      'function' => string 'log_error' (length=9)
  1 =>
    array (size=3)
      'file' => string 'C:\wamp64\www\Sources\Subs.php' (length=30)
      'line' => int 5944
      'function' => string 'load_file' (length=9)
  2 =>
    array (size=3)
      'file' => string 'C:\wamp64\www\Sources\Subs.php' (length=30)
      'line' => int 5762
      'function' => string 'call_helper' (length=11)
  3 =>
    array (size=3)
      'file' => string 'C:\wamp64\www\Sources\Load.php' (length=30)
      'line' => int 526
      'function' => string 'call_integration_hook' (length=21)
  4 =>
    array (size=3)
      'file' => string 'C:\wamp64\www\index.php' (length=23)
      'line' => int 142
      'function' => string 'reloadSettings' (length=14)
Error loop.

Title: Re: smf and wampserver
Post by: shawnb61 on February 26, 2023, 08:08:34 PM
As suggested above, delete the loadavg_enable entry in the settings table.

I don't think you should have deleted that table.  Generally not a good idea. 

But try deleting that entry & see where that gets you.
Title: Re: smf and wampserver
Post by: dodos26 on February 27, 2023, 09:30:32 AM
Wamp installs various php and other add-ons by default. Maybe one is disabled? Or missing? For me work on windows.
Try use IObit unistaler for unistall wamp and try install clear new forum. First create new account msql and use it.
Title: Re: smf and wampserver
Post by: lord alibaski on February 27, 2023, 05:23:14 PM
I have uninstalled it all and I am going to start from fresh.

So is this the best way to do this

Install wamp - install smf using default database - database created and forum installed

Now I have opened up phpmyadmin and the database prefix it created was smf not smf_

Where is my main forums sql file being uploaded to next? I have uploaded it to the smf table before but this is where nothing happens, so any suggestions are welcome.

Thanks
Title: Re: smf and wampserver
Post by: vbgamer45 on February 27, 2023, 05:55:45 PM
I would redo the table prefixes for sure. If you can should be smf_ as the table prefix by default.
Title: Re: smf and wampserver
Post by: lord alibaski on February 28, 2023, 04:46:42 AM
That was the 1st thing I did.

What procedure would you do next!
Title: Re: smf and wampserver
Post by: vbgamer45 on February 28, 2023, 10:29:00 AM
Is the forum working now? the new install?
Title: Re: smf and wampserver
Post by: lord alibaski on February 28, 2023, 12:38:42 PM
The default SMF install always works it's as soon as I try changing the database over to the database I upload that's when all the problems begin.
Title: Re: smf and wampserver
Post by: dodos26 on February 28, 2023, 03:58:20 PM
So everything points to some sql version incompatibility. I would look for differences between the default tables and the old tables, and try convert.
Title: Re: smf and wampserver
Post by: lord alibaski on March 02, 2023, 05:56:52 PM
Quote from: dodos26 on February 28, 2023, 03:58:20 PMSo everything points to some sql version incompatibility. I would look for differences between the default tables and the old tables, and try convert.

Lost me with that one lol How would one go with converting all tables at once?