Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > fopen() permissions in php

fopen() permissions in php
Thread Tools
Mac Enthusiast
Join Date: Oct 1999
Location: Brooklyn, NY, USA
Status: Offline
Reply With Quote
Jan 4, 2002, 11:30 AM
 
I'm trying to get Netjuke (a cool-looking, web-based MP3 jukebox: http://netjuke.sourceforge.net/) running, and am having some file permissions problems.

I have PHP and MySQL installed, and I installed the app. When I want to import the MP3 file information, the app craps out with the following error:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier> fopen(<font color = red>"/Users/josh/Sites/netjuke/admin/tabfile-import/bckp-<font color = blue>1010163343</font>"</font>, <font color = red>"w"</font>) - Permission denied in /Users/josh/Sites/netjuke/lib/inc-admin.php on line <font color = blue>36</font> </font>[/code]

I'm guessing that this is because whatever user PHP runs under doesn't have write access to that directory, but I can't figure out how to fix it. Any ideas?

TIA...
     
Forum Regular
Join Date: Nov 2000
Location: Oslo, Norway
Status: Offline
Reply With Quote
Jan 9, 2002, 11:20 AM
 
Depends on what user is running Apache.

I think this will work (Turns on write access for everyone, not very secure.)
In the terminal type:
sudo chmod a+w /Users/josh/Sites/netjuke/admin/tabfile-import
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Jan 9, 2002, 11:31 AM
 
The Web server needs to be able to write to the document. On OSX, that's the user "www" (no quotes, of course).

There are several ways to go about getting the permissions working right. But that's the crux of the thing: user www needs write access.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:28 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2