Jump to content

Selfhosting Mybb Issues


Kieran
 Share

Recommended Posts

Hey, I decided that 60 to 80 dollars is a crapload of money to add to the sixty bucks I'm already paying annually for my webhotel and domain. So I decided to give self-hosting a proper shot after all.

 

I'm running into several problems and I think, I hope, someone here could give me advice on this one problem in particular. I started a thread on mybb support forums but in two full days nobody has replied anything at all. Before I started that as well as after, I have googled  for hours trying to figure out and solve the problem. So I'm reaching out here as well.

 

Problem:

 

When I try to upload an avatar it fails and claims the file is not valid.

 

What I've tried so far from threads I managed to google:

 

- Checked the Attachment Types list. It includes the types I've tried to upload.

 

- I uploaded the uploadtest.php script into the avatars folder in the uploads folder, ran it and it turned out with no errors and said the file was uploaded. The file turned up in the avatars folder. But it also created a file called "error_log". Which log says something about undefined index?

 

- I checked my PHP Info in the Tools & Maintenance and the Environment section's TEMP & TMP & TMPDIR variables all have value /tmp. The uploads' avatar folder's user permissions are Full modify, (777.)

 

The threads that spoke of the latter two things also say something about some code possibly missing in the php.ini file. I don't own the server I'm on but am just buying space, so I don't have access to that file. And could it really even be anything in that file since the uploadtest.php script uploaded a file...?

 

So what the heck could the problem be?? I'm especially confused now that that test script uploaded a file just fine but the actual avatar uploading page on my board doesn't. The same problem occured on the second board I brought over.

 

Any advice would be highly appreciated!

 

 

 

CoM_title_forum_2021.png

CHILDREN OF MERLIN - HARRT POTTER 1980S RPG
| Small app | Fluid time | Lots of species |

Link to comment
Share on other sites

  • Admin
  • I uploaded the uploadtest.php script into the avatars folder in the uploads folder, ran it and it turned out with no errors and said the file was uploaded. The file turned up in the avatars folder. But it also created a file called "error_log". Which log says something about undefined index? Undefined index is a database issue. Either with myBB itself or the database.
  • php.ini files (as long as permitted by the host) can be placed in each folder to change the values. This shouldn't matter but you should try adding the file and seeing if it fixes the issue.

 

I will say that a test script can be garbage because it's obviously not using the same variables. There should be another error log that tells you "WHY" the file wasn't uploaded if the actual upload is hitting the server properly other @Kit the Human ideas?

0_mainsignature.jpg

image.png

Profile set made by myself and original Artwork by Fae Merriman, my daughter.

 

 

Link to comment
Share on other sites

In this guide I talked about changing the avater upload path. Have you checked that?

 

On the ACP: 

Go to Configuration > Settings > Profile Options

Scoll down to Avatar Upload Path and make sure that it's set to ./uploads

 

To triple check that it's set correctly, go to your CPanel and then File Manager:

Right click on Public_HTML > Inc > settings.php download it to back up the file.

 

Find

$settings['avataruploadpath'] =

And make sure that it's set to

$settings['avataruploadpath'] = "./uploads/avatars";

 

Let me know if that helps at all.

 

sig.png.30b42565d04d922988370bf14e1447bc.png

PSI: an Occult Investigations RP

Roleplay Architects: Grab a friend (or many friends!) and just write.

You can also find me at:

static-historicalrp.jpg  B8CB4x.png rpabutton.png

Link to comment
Share on other sites

I don't think my host allows that. I can't find PHP Config or anything like that on my cPanel home page. So I really hope it doesn't matter at any point with anything. Though, my host has a great customer service but contacting them would of course take much more time than if I could do something myself with the help of others in communities.

Ah, no, I hadn't got that far in your instructions yet. Got distracted by other problems. The avatar upload path did take to the uploads folder. But it included other stuff too. Now when I cut it to say just that ./uploads/avatars - the uploading works, on both of the two boards I've brought over so far. Thank heavens it wasn't anything major!

Thank you ever so much, both of you!! Now, if you or anyone can still advice me on one other significant prob, I think all will be set because everything else seems to function fine.

The cdnurl "staticl8.icyboards.net/sitename" keeps coming back no matter how many times I remove it. And thus it keeps breaking the Enhanced Account Switcher through a JavaScript error.

 

Edited by Kieran

CoM_title_forum_2021.png

CHILDREN OF MERLIN - HARRT POTTER 1980S RPG
| Small app | Fluid time | Lots of species |

Link to comment
Share on other sites

6 hours ago, Kieran said:

I don't think my host allows that. I can't find PHP Config or anything like that on my cPanel home page

 

PHP MyAdmin? You only need that for the database import, the rest is done through File Manager.

 

More to the point, thank you so much for reporting your issue with the Account Switcher. I was able to replicate and fix and will update the guide accordingly.

 

Go to your admin control panel 

Click on Configuration

Settings

Server and Optimization Options

 

Scroll down to Uploads Path and change it to

./uploads

 

Scroll down to Use a CDN? And set to no.

Click Save Settings.

 

That should fix that issue. Again, thank you so much for reaching out. It really helps me to know where people are stumbling so that I can update our guides to better reflect that.

 

sig.png.30b42565d04d922988370bf14e1447bc.png

PSI: an Occult Investigations RP

Roleplay Architects: Grab a friend (or many friends!) and just write.

You can also find me at:

static-historicalrp.jpg  B8CB4x.png rpabutton.png

Link to comment
Share on other sites

Sorry about the double post, but in case you already read that previous one.

Problem: whenever I try to access my board through https:// the theme gets all messed up. I know I have to change all the internal links, but where exactly? In the global.css of the theme? Or in every single css there is? And is there anything else I need to do to make it function properly when accessed through https://?

EDIT: Oh, and then also, I noticed that in my headerinclude I have something called "ibthx" which includes a bunch of stuff like this "background: url(http://static1800.icyboards.com/preeria/images/buttons_sprite.png) no-repeat 0px -440px!important; }"

^ Does that mean that once IcyBoards closes down all my buttons break? What should I replace that with, or should I just remove it all?

Edited by Kieran

CoM_title_forum_2021.png

CHILDREN OF MERLIN - HARRT POTTER 1980S RPG
| Small app | Fluid time | Lots of species |

Link to comment
Share on other sites

Sounds like it was an issue with the prostats templates then!

 

For the second thing, you don't need to include the entire URL of any images you have uploaded to your site.  This for example:

background: #666A73 url("images/focus/pattern.png") repeat scroll left top;

Is sufficient.

 

If that's not the issue, ensure that the Board URL under ACP > Configuration > Site Settings is correct (including the https://)

 

You can also try changing your Secure Cookie Flag setting to see if that helps.

 

Hope that does something for you!

 

sig.png.30b42565d04d922988370bf14e1447bc.png

PSI: an Occult Investigations RP

Roleplay Architects: Grab a friend (or many friends!) and just write.

You can also find me at:

static-historicalrp.jpg  B8CB4x.png rpabutton.png

Link to comment
Share on other sites

Ohh! The Board URL was the issue, or at least that alone seems to have fixed it. Thanks!

But I already linked the boards with the http:// url to a few people. Is there a way to force those links to automatically redirect them to the https:// version? I found something to put into the htaccess file but it only works when the http:// version is typed into the url bar. It doesn't affect any existing links or bookmarks.

Also, I wish I ran out of issues already. But I noticed that the Enhanced Account Switcher's "Change Author of an Existing Post" function isn't functioning. The arrow button is there and clicking on it brings up the Change author link--but when I click on that it deletes the scroll bar from the right side of my screen and thus freezes the screen. I know it's supposed to bring a pop-up window to do the author changing in, because it functions perfectly fine on another one of my boards that I worked on earlier. I copy-pasted some templates from that functioning one, but it doesn't help.

These are the accountswitcher templates I copy-pasted:

 _author_button
_author_change
_author_userbit
_post
_post_userbit
_postbit
_postbit_link
_postbit_switch

Shouldn't the issue have been in one of those??

Also, I think I'm supposed to be able to change the post author of any post, no matter which member posted it or at least of any of my accounts' posts, on my admin account--but I can't. The arrow isn't even there when I view the threads as an admin. Unless it's a post I posted as the admin.

Edited by Kieran

CoM_title_forum_2021.png

CHILDREN OF MERLIN - HARRT POTTER 1980S RPG
| Small app | Fluid time | Lots of species |

Link to comment
Share on other sites

Throughout your templates, you will find a variable {$mybb->settings['bburl']} < that is spitting out the value of the Board URL setting. That is also what mybb sticks in front of "images/focus/pattern.png" - so if that's off, a lot of your paths will be off!

 

Last time I needed to do htaccess, I asked for @Morrigan's help. Though I think my htaccess didn't work because I was editing the one that's already there, rather than creating a new one. Try creating a new htaccess file?

 

It's hard to diagnose the account switcher without a link to your forum/templates. At a guess:

 

- Javascript conflict:

Have you added any new javascript?

If yes - Does the account switcher work on the default theme on that forum?

If no - What other plugins have you installed?

 

- Templates:

Does the postbit and postbit_classic templates have 

{$post['authorchange']}

Does accountswitcher_author_button have

{$admin_change}

 

Have you changed the classes or IDs in the postbit template? I've created issues for myself in the past by changing some of the classes and IDs. (If the default theme doesn't work, then it's not this or javascript.)

 

The admin thing could be the setting:

ACP > Configuration > Settings > Enhanced Account Switcher

Team change post author - should be yes.

 

Let me know how you go - apologies I can't be definitive on this one.

 

sig.png.30b42565d04d922988370bf14e1447bc.png

PSI: an Occult Investigations RP

Roleplay Architects: Grab a friend (or many friends!) and just write.

You can also find me at:

static-historicalrp.jpg  B8CB4x.png rpabutton.png

Link to comment
Share on other sites

Oh! Oh! Thanks for mentioning JavaScript. I had forgotten to update my JavaScript for this board, that assets thing in the headerinclude you advice in your tutorial. Did that and now the author changing functions on this board, too. And yep, that settings option was marked No.

And sorry, how thoughtless of me not to link the board.
It's this board.

I noticed that I can't add any accounts on any of my character accounts. On the account switcher page of the User CP it only shows what accounts it has been attached to. (My admin account where everything functions fine.) Is that how it's supposed to be? Whichever account a user first attaches another account to becomes a "Master Account" and then more can be attached through that one only? I thought it was different but I may be remembering IcyBoards' version of this plugin.

As for the htaccess thing...I read somewhere that you shouldn't create an htaccess file if you already have one? Also, I found so many variations of the RewriteCond and RewriteRule codes on google results that I don't even know which one really to use. But I did try three of them and none of them would redirect when entering through an external http link, but only when the url is typed on the bar and when clicking something on the board. Except the login and register links which will remain on the insecure version.

Edited by Kieran

CoM_title_forum_2021.png

CHILDREN OF MERLIN - HARRT POTTER 1980S RPG
| Small app | Fluid time | Lots of species |

Link to comment
Share on other sites

No worries!

 

15 hours ago, Kieran said:

I noticed that I can't add any accounts on any of my character accounts. On the account switcher page of the User CP it only shows what accounts it has been attached to. (My admin account where everything functions fine.) Is that how it's supposed to be? Whichever account a user first attaches another account to becomes a "Master Account" and then more can be attached through that one only? I thought it was different but I may be remembering IcyBoards' version of this plugin.

 

Yes - that's the way it's supposed to be. Spork's version did not specify master accounts. The Enhanced Account Switcher and icyboard's switcher are pretty different beasts.

 

Shouldn't the log in and register links use secured cookies? So that the information sent through them (passwords in this case) is only being sent to your forum, not being hijacked by someone else, and is encrypted? I know that the user will appear logged out if they log in via https:// and then reaccess the site by http:// - but we're going to fix that.

 

Writing another htaccess file presented no issues for me, but I'm speaking to Morrigan.

 

sig.png.30b42565d04d922988370bf14e1447bc.png

PSI: an Occult Investigations RP

Roleplay Architects: Grab a friend (or many friends!) and just write.

You can also find me at:

static-historicalrp.jpg  B8CB4x.png rpabutton.png

Link to comment
Share on other sites

  • Admin

So htaccess is a special beast. You can always add to an htaccess but unless you know what you're doing I don't recommend subtracting, it's highly likely that there is something in there that makes your board work.

 

As for redirecting http to https it is the htaccess that does this.

 

Adding this:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTPS} !on
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
  </IfModule>

This should force ANYTHING http to https.

  • Thank you 1

0_mainsignature.jpg

image.png

Profile set made by myself and original Artwork by Fae Merriman, my daughter.

 

 

Link to comment
Share on other sites

It doesn't. I left out that </IfModule> closing because in my htaccess file there's a long list of other RewriteRules and thus it already had that closing bit. So what I added are the third and fourth lines from that code, I added them right under that RewriteEngine on like you have there so it definitely is in the correct spot. But still, when I go to the message I sent to the couple of members with the http:// link, clicking through it will keep it http:// even when clicking on Login right after arriving on the index page. It won't force it to https://. It will force the Register link, though. I guess it won't do that for the Login because it's a pop-up? It won't on any of my boards, but let's test with this one.

And then...Newest in my endless seeming series of issues occurs on this board. Right now, the config.php of the board refers to the table prefix of the imported database--not to the default's. When there's a lock in the install directory, it complains about Error 42, claiming that my board has not been upgraded and that I should upgrade it before attempting to browse it. I don't know why because I did install the latest version, it even said so when I checked it from the ACP.  This actually happened with every single one of my boards but I was able to "upgrade" it just fine no matter which table prefix.

With this one I can't. Obviously when there's the lock I can't use the upgrade feature. But when I remove the lock file, it complains about error 43. Well, when the table prefix in the config.php refers to the default it lets me use the upgrade feature without asking my admin username and password and it runs it just fine. But when I try to upgrade it when the table prefix is to the imported ones...It wants my username and password BUT won't recognize the password, claims it's not correct. And I swear it's 100% correct because I used it to login to the ACP.

Edited by Kieran

CoM_title_forum_2021.png

CHILDREN OF MERLIN - HARRT POTTER 1980S RPG
| Small app | Fluid time | Lots of species |

Link to comment
Share on other sites

  • Admin

The htaccess issue is likely conflicting re-write conditions. Can you copy that whole section of your file to here please?

0_mainsignature.jpg

image.png

Profile set made by myself and original Artwork by Fae Merriman, my daughter.

 

 

Link to comment
Share on other sites

Have you tried upgrading through softaculous?

 

If that doesn't help you, can you go into your cpanel > file manager > public_html > view index.php ?

 

At the very top there is 

<?php
/**
 * MyBB 1.8
 * Copyright 2014 MyBB Group, All Rights Reserved
 *
 * Website: http://www.mybb.com
 * License: http://www.mybb.com/about/license
 *
 */

The above tells me that I'm on MyBB 1.8. Can you confirm that you're on 1.8?

 

You might also be able to confirm via cpanel > phpmyadmin > click on the dtabase > click on datacache. There might be a field on the right that says version and next to that, there will be the version number.

 

sig.png.30b42565d04d922988370bf14e1447bc.png

PSI: an Occult Investigations RP

Roleplay Architects: Grab a friend (or many friends!) and just write.

You can also find me at:

static-historicalrp.jpg  B8CB4x.png rpabutton.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.