New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

permission's mystery


Post Reply New Thread Subscribe

 
Thread Tools
typhophoh

 
Member Since: Nov 27, 2011
Posts: 5
typhophoh is on a distinguished road

typhophoh is offline
Hello.
My MAC OS is Leopard and I use the computer personally, i.e. I'm admin user.
I've just started PHP, so I created a local server and changed the computer's permission to make it work.

My question is why 755 doesn't work for a simple PHP program, but 777 works.
Permissions for the folder and files are like this
:the folder in Sites/ ---777, php files in the folder ---755

I think '7'55 should be enough because I am the admin, neither a guest nor a member of some group. However, 755 for the folder doesn't work.
Would anybody help me to solve the mystery?
Thanks.
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,638
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
I highly doubt that your server instance (assuming it's a daemon) is running as your user.

You certainly should NOT run this as 777, 755 is indeed preferable. You'd need to change the owner to the user running your server instance using chown. That'd do it.

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks
typhophoh

 
Member Since: Nov 27, 2011
Posts: 5
typhophoh is on a distinguished road

typhophoh is offline
I still don't understand the difference between administrator and root user...
Any way, I 'll try chown, thank you Dysfunction!
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,638
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
Here's the deal. Say you're running apache. Generally this is run by a non-privileged user (such as "www"). So, if you chown www <file> it should be able to execute your PHP script. This has nothing to do with the user you're logged on as. In fact, running servers as your (privileged) login would be a VERY bad idea indeed. There are a TON of exploits that exist in various daemons.

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,352
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
There's also a difference between administrator and root in OS X. Take a look here. They're close but root is one step closer to absolute/unrestrained control.

Dysfunction is very much correct on this one - 777 is a terrible set of permissions for what you're trying to do. It's a "quick fix" for most problems but it's a terrible one. I understand why you'd want to do it though - PHP scripts can be frustrating if they don't have the perfect set of permissions (I can't tell you the number of times this has frustrated me).

I've noticed that this problem generally pops up when you move scripts across machines. Are you doing development across machines?

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks

Post Reply New Thread Subscribe


« Default perms by Windows on Lion shared drive | cant find migration assistant in os 10.1.2 puma »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting 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 Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
help me tame lion! danni1 OS X - Operating System 2 11-17-2011 01:25 AM
The infamous 10.5 "permissions differs on" stejimenez OS X - Operating System 4 08-16-2009 12:07 PM
Disk permissions error Pagal Haina OS X - Operating System 6 04-11-2009 07:37 PM
Not too pleased with new iMac JunMacTech Apple Desktops 14 12-05-2005 08:13 PM
repair permissions a waste of time? Macman Schweb's Lounge 5 05-31-2005 07:26 PM

All times are GMT -4. The time now is 01:54 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?