PHP Error

Discussion in 'Mac Programming' started by Jimmieboy, Dec 29, 2006.

  1. macrumors 6502

    Jimmieboy

    Joined:
    Oct 30, 2005
    Location:
    Australia
    #1
    Hey everyone. I have a problem when using php. I'm using Apache at home and I cannot seem to view any php files that weren't created on my computer. When trying to access something that was created by someone else or on a different computer I get a message saying that I don't have permission to access whatever folder on this server. Anyone know a way around this?
     
  2. macrumors demi-god

    fishkorp

    Joined:
    Apr 10, 2006
    Location:
    Ellicott City, MD
    #2
    sounds like they uploaded the files to a directory that only their user can read? if that's the case have them (or someone with sudo/root) chmod the folder/files to 755.
     
  3. thread starter macrumors 6502

    Jimmieboy

    Joined:
    Oct 30, 2005
    Location:
    Australia
    #3
    I don't think I made it clear. What happens is if I try to access php files sorted on my computer but created on a different machine. I get the error that I mentioned above.
     
  4. macrumors 68030

    slooksterPSV

    Joined:
    Apr 17, 2004
    Location:
    Nowheresville
    #4
    Well the only way around it is to chmod 755 the folder and the files, which you can easily do like so

    chmod -R 755 folder
    --if the files are on your machine locally

    --if they are on a server, you're SOL

    As for accessing it if you don't have permission to access it, you're SOL, its a security feature. To access PHP files you have to give it 755 permissions, which I think is rx (read and execute, or maybe its just execute). Anyways hope that helps.
     
  5. macrumors regular

    Joined:
    Feb 14, 2006
    #5
    How did you transfer the files? Were they emailed, or did you scp or ftp them down? Or did someone burn them to a CD?

    However you did it, its possible that the file permissions somehow came along with it. If its a burnded CD or some other sort of media, its most definately that the permissions came with it.

    The best bet is to sudo over to root, chown the files to your ID, and chmod then 755 (rwx r-x r-x). Then you should be good.
     

Share This Page