MyBB Community Forums

Full Version: PHP Upgrade before MyBB upgrade and some errors are now showing up
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello,

Hope this is the correct place to post this.

Got an email from my hosting service that they will be upgrading their servers to PHP 7.4 in the coming days. They recommend that I upgrade all of my web installations to the newest PHP software available before they move my account. This in itself was a little confusing since I was able to use MultiPHP Manager to upgrade my PHP.

Here is my setup:

Forum URL: http://rswasserboxer.com/R1200RSforum/
Old PHP Version: 5.6.40
New PHP Version: 7.4.28
MyBB Software Version: 1.6.12
MySQLi 5.6.41


The PHP upgrade went fast and there were no errors. I was able to confirm that indeed the PHP version was 7.4.28 and the MyBB version is still 1.6.12, which I have not touched yet.

I can read the forum posts and can access the various CP. However, there are issues which so far are as follows:

Create new thread - Warning is issued as follows:

Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 734 - File: newthread.php PHP 7.4.28 (Linux)
File = /newthread.php
Line = 734
Function = errorHandler->error

"View New Posts" OR "View Today's Posts" OR "Reply" to a post

HTTP ERROR 500


How do I fix this? Could it be because the host has not yet done something on their end?
MyBB 1.6.12 is over 8 years old. It is not compatible with a PHP version that was released years later. You need to upgrade to the latest MyBB version.
For context, the current version of PHP was 5.5 when MyBB 1.6.12 was released (which was December 2013) so not even your previous version of 5.6 had official support - PHP 7 didn't even exist (and your new version PHP 7.4 was released in November 2019, so 6 years after MyBB 1.6.12).

As Stefan said, MyBB will need to be upgraded as well. However, as you're on such an old version, your plugins will need to be updated or replaced too (I can see you're using the default theme so that makes that easier at least).

In future I would recommend keeping your board up to date. Not updating it for 8 and a half years means you're incredibly behind on security fixes (you're very lucky not to have been hacked). Forums are like any website, they need to be maintained and kept up to date, otherwise you run into issues like this where you need to upgrade PHP but the website software is ancient and not compatible.
Matt and StefanT - Thanks for your answers. I had suspected that was the case. Yes, I had not upgraded PHP or MyBB in a while (didn't even have the Forum up that long AAMOF - that was the version offered on the host!). The Forum was working fine for us and so there was no immediate incentive to update.

OK so here is my new issue. Before I update MyBB I did a backup and I am amazed how small the file size is. I don't believe it.

[attachment=45126]

How could my entire forum, including user pictures in the uploads directory, only be 2 MB? I selected structure and data. And where would be my data files (forum posts) in that folder heirarchy?

The upgrade steps here appear to be clear, but I don't want to start doing this and wipe out my forum, especially when I don't believe that the backup that MyBB is creating is all of the structure + posts + images.

The installation instructions appear ambiguous, saying copy / overwrite, but it might ask you to run the upgrade script. I have a bit more faith in the copy/overwrite method, especially if I know what my data files were. But would running the upgrade script leave my data intact?

What can you advise?
That backup is only the database, which is probably about right considering it’s compressed and it’s a small forum. You can take a backup via phpMyAdmin to compare file sizes, but the MyBB database backup should be fine. You’d need to back up your files separately to have all the forum files and attachments.

When upgrading, you’ll need to upload a full copy of 1.8.30 over your existing files, and go to /install/upgrade.php to run the upgrade script.
I’ve also removed that screenshot because someone would have been able to download that file and have access to your database.
You probably already know this, but to be clear, make sure that you download all the files and folders on your website- to your personal computer.
That should include all photos and attachments.
(2022-05-05, 10:16 PM)Matt Wrote: [ -> ]That backup is only the database, which is probably about right considering it’s compressed and it’s a small forum. You can take a backup via phpMyAdmin to compare file sizes, but the MyBB database backup should be fine. You’d need to back up your files separately to have all the forum files and attachments.

When upgrading, you’ll need to upload a full copy of 1.8.30 over your existing files, and go to /install/upgrade.php to run the upgrade script.

Matt,

When you say "only the database" I take it you mean only the text in the posts, right? If that is the case then the backup is not truly a full backup as the images / attachments are not included. And if that is the case then Cloudybright's suggestion (thank you) was a good one - to copy everything in the file structure to my laptop.

But where (as in which folder) is the database stored? I looked through all the folders and am not seeing any file with a current date and a significant size. Only the sub-folders of uploads has current files but they are all images.

Yes I figured I would have to upload a full copy of 1.8.30 over the existing files. I already have it downloaded since last night. Sounds like you are confirming that the upgrade script should be run.

(2022-05-05, 10:17 PM)Matt Wrote: [ -> ]I’ve also removed that screenshot because someone would have been able to download that file and have access to your database.

Wow ... didn't know that ... from a screenshot? Thanks.
The database has all the non-file data. Forums, threads, posts, users etc. That's what you can backup via the MyBB ACP or phpMyAdmin. You will still need to back up the forum files and attachments too. They're different things and you need both. The database is not stored anywhere in your file system, MySQL is installed elsewhere on the server and the database is handled elsewhere, you just need to take the backup of the data from it, which you have.

Also yes, the upgrade will most certainly need to be run, you're upgrading through about 35 releases, including the major 1.6 > 1.8 upgrade step.

Finally, yes, the screenshot showed the full name of the .sql.gz backup file, so anybody would have just been able to go to that in their browser. Careful when screenshotting paths to sensitive files! Smile
(2022-05-06, 12:01 AM)Matt Wrote: [ -> ]The database has all the non-file data. Forums, threads, posts, users etc. That's what you can backup via the MyBB ACP or phpMyAdmin. You will still need to back up the forum files and attachments too. They're different things and you need both. The database is not stored anywhere in your file system, MySQL is installed elsewhere on the server and the database is handled elsewhere, you just need to take the backup of the data from it, which you have.

Also yes, the screenshot showed the full name of the .sql.gz backup file, so anybody would have just been able to go to that in their browser. Careful when screenshotting paths to sensitive files! Smile

Right ... OMG I can't believe I did that. Hey, over the years I have forgotten what little I knew about Linux servers and such and I am sure that it shows now. Yes now that I look at it, it could be inferred from the screenshot.

Thanks for also confirming that the database is stored elsewhere (which is why I can't see it) and explaining about what it has.

OK it sounds like I need to modify the htaccess file to take the forum down and then do the upgrade. Maybe a task for this weekend.  Confused
Pages: 1 2