Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Help:
safe mode restrictions
zed



Joined: 10 Aug 2003
Posts: 427
Location: switzerland

Posted: 08/10/03 09:52 
hello Brian,

while testing jamroom a php error occured.

jamroom install has been a breeze, no problems at all. when testing all the functionality I created two audio files (mp3) for upload testing (just 100k, well below the upload limit). when I tried to upload the song i received an error that loops as following:


Quote:
Warning: SAFE MODE Restriction in effect. The script whose uid is 387 is not allowed to access /home/sites/site96/web/mp3/songs/1/4_hifi.mp3 owned by uid 15 in /home/sites/site96/web/mp3/include/jamroom-header.inc.php on line 52

Warning: fopen("/home/sites/site96/web/mp3/songs/1/4_hifi.mp3", "rb") - Success in /home/sites/site96/web/mp3/include/jamroom-header.inc.php on line 52

Warning: SAFE MODE Restriction in effect. The script whose uid is 387 is not allowed to access /home/sites/site96/web/mp3/songs/1/4_hifi.mp3 owned by uid 15 in /home/sites/site96/web/mp3/include/jamroom-header.inc.php on line 39

Warning: fopen("/home/sites/site96/web/mp3/songs/1/4_hifi.mp3", "rb") - Success in /home/sites/site96/web/mp3/include/jamroom-header.inc.php on line 39

Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site96/web/mp3/include/jamroom-header.inc.php on line 40

Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site96/web/mp3/include/jamroom-header.inc.php on line 41

Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site96/web/mp3/include/jamroom-header.inc.php on line 40

Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site96/web/mp3/include/jamroom-header.inc.php on line 41


the last loop continues until I press the stop button in the browser or my server gets angry.

a little more information:
I do not have root access and the server is running php in safe mode. apart from the problem mentioned above safe mode has not caused any problems, I can create and modify bands etc.. and everything else is 100%ok. and yes, I've chmoded bands, config, uploads and songs to 777, same with all subfolders.

when this error occured i chmoded the include folder and all files to 777 which did not change anything.


hope you can tell me what I did wrong or make this possible for safe mode users in a future release.

zed
.
[/quote]



Last edited by zed on 08/10/03 10:06; edited 1 time in total
Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 08/10/03 10:00 
Zed -

real quick - do you have shell access to your website? The problem is that when PHP Safe Mode is on, the OWNER of the folder ( in this case /songs/1 ) MUST be the same user ID as the person who owns the jamroom SCRIPTS. Does this make sense? for example, lets say your user name on your website (what you use to login or FTP in as ) was "brian". When you upload your data to the website, all of the Jamroom files become "owned" by brian. Even though the sub directories may be chmod'd to 777, they must ALSO be owned by "brian".

A quick way to see if this is the case:

log into your site via FTP, go to the "songs" directory and delete directory number 1. now re-create that directory and permission it to 777. If it works it means that the "1" directory did not have the same owner ID as your FTP login (this could have happened if Jamroom created the directory).

Let me know if this helps - if it does, just remove and remake the other directories in songs and bands.

Jamroom beta 4 has better support for Safe Mode, and should hide many of the errors as well as work better all around when Safe Mode is enabled. Watch for beta 4 coming this week.

Thanks!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
zed



Joined: 10 Aug 2003
Posts: 427
Location: switzerland

Posted: 08/10/03 10:07 
nope - no shell access on this account. will try re-creating the folder and let you know.

thanks for the quick help

zed
.

Back to top
zed



Joined: 10 Aug 2003
Posts: 427
Location: switzerland

Posted: 08/10/03 10:11 
yes, re-creating the folder solved the problem. I can now upload mixes to that bands folder.

is there anything I can change so jamroom has same uid when creating a folder as when I do? or do I have to re-create the song folder with every new band?

thanks again
zed
.

Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 08/10/03 10:19 
Unfortunately this is one of the restrictions of PHP Safe Mode - anywhere that a PHP script (in this case Jamroom) needs to write data to the filesystem, PHP checks and matches the user ID of the script versus the user ID of the folder it is going to write too - if they do not match, then it wont allow the write to happen.

When Jamroom is actually running, it assumes the User ID of the apache webserver (usually user "nobody") and therefore wont have the same User ID as your scripts. If Jamroom creates the directories for you then we end up having this problem. (if you are familiar with web technologies there is no "setuid" for PHP that would allow Jamroom to create directories as your user ID - it opens many security holes).

To make a somewhat long story short, there really is no work around if you happen to be on a server that runs in Safe Mode. The easiest thing to do is:

Log in with your FTP client, delete all of your numbered sub directories in songs and bands, and re-create them. I would make like 25 directories in each so you don't have to worry about it for a long time. I know this isn't any fun to do but would only need to be done once (or until you pass 25 bands).

Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Help

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.