Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avater directory not reachable for upload #3442

Closed
5050 opened this issue Sep 11, 2018 · 5 comments
Closed

avater directory not reachable for upload #3442

5050 opened this issue Sep 11, 2018 · 5 comments

Comments

@5050
Copy link

5050 commented Sep 11, 2018

Hi,
Our forum generated many notifications for issues with this message :

Your copy of MyBB running on XXX Forums (http://XXX) has experienced an error. Details of the error include:
---
Type: 2
File: inc/functions_upload.php (Line no. 160)
Message
opendir(): open_basedir restriction in effect. File(./uploads/avatars) is not within the allowed path(s): ([i]/var/XXX/[/i])

I solved them by changing line 160 in inc/functions_upload.php from
$dir = opendir($avatarpath);
by
$dir = opendir(realpath($avatarpath));

I'll not open a pull request because I have no certitude at all this is the best solution, or even the correct one.

Best regards, thanks for myBB project

@AndreRl
Copy link
Contributor

AndreRl commented Sep 11, 2018

By the looks of it this is more to do with your PHP settings then MyBB.

@5050
Copy link
Author

5050 commented Sep 14, 2018

Can you tell more ?

@Ben-MyBB
Copy link
Member

Yes, open_basedir restriction is the issue.

@5050
Copy link
Author

5050 commented Oct 1, 2018

  • If it is a php setting mistake, can you tell more because we do not see which.

  • If open_basedir is the problem, can you explain why the relative path fails but the full path works fine ?
    BTW I confirm that ./uploads/avatars is inside the open_basedir tree,, like all other directories used by the forum.

@WildcardSearch
Copy link
Contributor

@5050 if you need support, please post on the community forums.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants