Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Jimmieboy

macrumors 6502
Original poster
Oct 30, 2005
297
0
Australia
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?
 

fishkorp

macrumors 68030
Apr 10, 2006
2,536
650
Ellicott City, MD
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.
 

Jimmieboy

macrumors 6502
Original poster
Oct 30, 2005
297
0
Australia
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.

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.
 

slooksterPSV

macrumors 68040
Apr 17, 2004
3,543
305
Nowheresville
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?

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.
 

mbabauer

macrumors regular
Feb 14, 2006
105
0
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.

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.