Results 1 to 5 of 5
  1. #1
    permission's mystery

    Member Since
    Nov 27, 2011
    Posts
    5
    permission's mystery
    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.

  2. #2
    permission's mystery
    Dysfunction's Avatar
    Member Since
    Mar 17, 2008
    Location
    Tucson, AZ
    Posts
    6,821
    Specs:
    Way... way too many specs to list.
    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!

  3. #3
    permission's mystery

    Member Since
    Nov 27, 2011
    Posts
    5
    I still don't understand the difference between administrator and root user...
    Any way, I 'll try chown, thank you Dysfunction!

  4. #4
    permission's mystery
    Dysfunction's Avatar
    Member Since
    Mar 17, 2008
    Location
    Tucson, AZ
    Posts
    6,821
    Specs:
    Way... way too many specs to list.
    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!

  5. #5
    permission's mystery
    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,395
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. A Mystery
    By mickibob in forum Images, Graphic Design, and Digital Photography
    Replies: 3
    Last Post: 08-12-2014, 05:39 PM
  2. Networking mystery
    By SOS 1985 in forum Internet, Networking, and Wireless
    Replies: 2
    Last Post: 07-29-2011, 03:14 PM
  3. G5 mystery noise
    By Earthcat in forum Apple Desktops
    Replies: 6
    Last Post: 04-22-2011, 10:20 PM
  4. Keyboard Mystery
    By Doug11 in forum Other Hardware and Peripherals
    Replies: 6
    Last Post: 04-09-2010, 05:49 AM
  5. Dashboard Mystery
    By Alan in forum OS X - Operating System
    Replies: 5
    Last Post: 06-02-2006, 09:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •