An error when uploading an avatar

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
Kalar
Registered User
Posts: 27
Joined: Fri May 13, 2011 7:50 pm

An error when uploading an avatar

Post by Kalar » Sun Jun 05, 2011 6:11 am

Support Request Template
What version of phpBB are you using? phpBB 3.0.8 RC1
What is your board's URL? http://www.renaissance.vacau.com/forums/
Who do you host your board with? 000webhost
How did you install your board? I used the download package from phpBB.com
Is your board a fresh install or a conversion? Fresh Install
Do you have any MODs installed? Yes
Is registration required to reproduce this issue? Yes
What MODs do you have installed? Background colors for groups
Ban users by x warnings
Forum Background for phpBB3
Lock New Topic on Submit
Moderator Needed
Prime Ban to Group
Prime Quick Style
Prime Trash Bin
User Rank Progression Bar Details
Warning Reasons
phpBB Mood Swings
phpBB mChat
What styles do you currently have installed? Dominion, Zephyr
What language(s) is your board currently using? British English
Which database type/version are you using? MySQL 5
What is your level of experience? Comfortable with PHP and phpBB
What username can be used to view this issue? I will PM it if needed
What password can be used to view this issue? I will PM it if needed
When did your problem begin? Today.
Please describe your problem. The following error when uploading an avatar:

[phpBB Debug] PHP Notice: in file /includes/functions_upload.php on line 835: tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/:/usr/lib/php:/tmp)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4539: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3691)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4541: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3691)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4542: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3691)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4543: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3691)
Generated by SRT Generator ($Rev$)

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21078
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket - definitely

Re: An error when uploading an avatar

Post by Mick » Sun Jun 05, 2011 6:24 am

It's a server configuration error and not a problem with phpBB. Send the host support team that error and they should be able to fix it by granting permissions to the tmp directory. There is a workaround but I suggest you speak to your host first.
"The more connected we get the more alone we become" - Kyle Broflovski

Eisenbart
Registered User
Posts: 25
Joined: Fri Jun 22, 2007 1:43 pm

Re: An error when uploading an avatar

Post by Eisenbart » Tue Sep 06, 2011 5:36 pm

I am not sure whether this really isn't a problem with phpBB. After all, open_basedir restrictions are a common way to prevent include attacks: http://blog.php-security.org/archives/7 ... usion.html

More information about open_basedir related error messages can be found here: http://www.ktuk.net/phpBB3/viewtopic.ph ... ir#p113275

I am using phpBB 3.0.9 and I ran into the same problem while trying to upload an avatar, but I was able to fix it by adding a check for open_basedir restrictions in file /includes/functions_upload.php on line 834, which reads:

Code: Select all

$tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? false : $phpbb_root_path . 'cache';
All you need to do is replace that line with the following one:

Code: Select all

$tmp_path = (@ini_get('open_basedir') || @ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on') ? $phpbb_root_path . 'cache' : false;

User avatar
Lumpy Burgertushie
Registered User
Posts: 66268
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: An error when uploading an avatar

Post by Lumpy Burgertushie » Tue Sep 06, 2011 10:41 pm

then I wonder why this problem doesn't come up all the time.

it is rare because most hosts do not have this setting in place.
now I would think that if it was all that much of a security problem, that most hosts would know about it and act accordingly.

since they dont, I have to assume that it is really not needed by those hosts that really know what they are doing.

as you mentioned, there is a workaround that can be done by editing those bits of code. that does not mean there is a problem with phpbb, it means that sometimes you have to work around foolish server setups.



robert
I am going to be out of town and off line for a week . see ya when I get back.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Eisenbart
Registered User
Posts: 25
Joined: Fri Jun 22, 2007 1:43 pm

Re: An error when uploading an avatar

Post by Eisenbart » Wed Sep 07, 2011 11:05 am

Well, as you can see, this problem does come up from time to time, and I would be surprised if Kalar and I were the only ones affected. Denying access to the system's temporary directory may be overcautious, but adding a check for open_basedir restrictions for those hosts that do consider this to be a safety issue shouldn't be too much effort either. Besides, there already is a "workaround" that uses phpBB's cache directory if safe_mode is switched on, so what's wrong with doing the same thing if open_basedir restrictions are in effect?

Lenwë
Registered User
Posts: 1
Joined: Tue Aug 24, 2010 4:02 pm

Re: An error when uploading an avatar

Post by Lenwë » Fri Nov 04, 2011 8:24 pm

Eisenbart wrote:I am using phpBB 3.0.9 and I ran into the same problem while trying to upload an avatar, but I was able to fix it by adding a check for open_basedir restrictions in file /includes/functions_upload.php
* link removed *

Same problem, same situation. Fixed for me, thanks ! :mrgreen:
Last edited by marian0810 on Fri Nov 04, 2011 10:59 pm, edited 1 time in total.
Reason: http://www.phpbb.com/rules/#rule5c

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: An error when uploading an avatar

Post by Oyabun1 » Sat Nov 05, 2011 2:07 am

Eisenbart wrote:... adding a check for open_basedir restrictions for those hosts that do consider this to be a safety issue shouldn't be too much effort either.
If you think there is a problem with the phpBB code then submit a bug report to the phpBB Bug Tracker, also include your suggested code change to fix it.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

Eisenbart
Registered User
Posts: 25
Joined: Fri Jun 22, 2007 1:43 pm

Re: An error when uploading an avatar

Post by Eisenbart » Wed Nov 09, 2011 2:57 pm


Locked

Return to “[3.0.x] Support Forum”