MyBB Community Forums

Full Version: PHP Errors after moving site from Shared hosting to VPS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I moved my site recently and mostly everything went smoothly except for 2 things:

1) The index page seems to be a bit messed up. The latest threads in the sidebar isn't working either.

2) The admin page gives me a ton of errors. https://www.emotionforums.com/admin/index.php

Warning [2] Use of undefined constant THIS_SCRIPT - assumed 'THIS_SCRIPT' (this will throw an Error in a future version of PHP) - Line: 37 - File: inc/plugins/google_seo/404.php PHP 7.2.3-1+ubuntu17.10.1+deb.sury.org+1 (Linux)

Warning [2] Cannot modify header information - headers already sent by (output started at /var/www/emotionforums.com/html/inc/class_error.php:229) - Line: 1919 - File: inc/functions.php PHP 7.2.3-1+ubuntu17.10.1+deb.sury.org+1 (Linux)


If I try to login I'll get the error 

Invalid administration session.

Is it because I'm using PHP 7.2? Any ideas?
exactly which version of MyBB you are using ?

MyBB is not yet fully compatible with php 7.2.x
can you downgrade php to 7.1.x or 7.0.x & check if it helps ..
Some of the functions have been deprecated in php 7.2 so if you can try to lower the php version to 7.1 and see if it changes anything or it is also possible you are missing some php plugins including simplexml, mbstring and gd
Thanks for the replies, guys. I downgraded to php version 7.1 and the errors are now gone, but I'm still having issues with the forum. It's not loading the "latest activity" panel on the homepage and when I enable Google SEO and the URLs change, they become downloads rather than webpages. There's also this weird blank square right next to each forum name.

Also, what PHP plugins does MyBB use? I've installed php7.1-xml, php7.1-mysql, php7.1-fpm and php7.1-mbstring. Do I need anything else?

Edit: Okay I fixed the Google SEO issue with it causing redirected pages to become downloads. It was an issue with the nginx redirection. The htaccess -> Nginx converter I used added unnecessary 'location' blocks for each redirect causing them to download rather than execute.

But the index page is still messed up. The latest threads sidebar isn't loading and <span class="catdesc"></span> is appearing as an empty dark square block. Any ideas?
Maybe an error because of 1800 jquery file? if it doesn't help try using a plugin https://community.mybb.com/thread-162649.html
Okay I fixed it, it was a jquery problem. The latest JQuery doesn't support $.cookie but instead Cookies.get. I went into the headerinclude file and updated all instances of $.cookie to Cookies.get

Looks like the creator of the theme fixed these problems in the latest version, but I've made a lot of changes to the theme so I never updated it.

Thanks, Dark-Power. I saw that error in the developer tools (browser) and didn't follow up on it too much.
Glad the problem fixed.

Just to clear the misunderstanding - jQuery does and always supports $ shorthand. The problem is not because of jQuery.
The jQuery Cookie plugin was dependent to jQuery library til version 1.41 (or so).
Now they have switched to pure javascript to avoid 3rd party library dependency and to act as an API, hence eventually changed the jQuery syntax.
The plugin is now called as js-cookie, the earlier jquery.cookie repository is archived.

Don't blame jQuery, its a lovely library, ever Big Grin