PDA

View Full Version : PHP Error




Jimmieboy
Dec 29, 2006, 06:53 PM
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
Dec 29, 2006, 10:35 PM
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
Dec 30, 2006, 05:29 AM
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
Dec 30, 2006, 04:28 PM
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
Jan 3, 2007, 03:39 PM
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.