Permissions problem

itid

Verified User
Joined
Sep 27, 2004
Messages
16
Location
Newcastle East Coast Australia
I have a script for uploading/deleting images in various directories.
The script somehow changed the permissions for one of the directories, and doesn't work for this dir.
Using FTP I got "permission denied" as well.
The website still displayed the images.
So, ....
In FTP I chmoded the permission to 755.
I could then access the dir via FTP.
Script then began to display the following sort of thing:
Warning: opendir(corporates/111) [function.opendir]: failed to open dir: Permission denied in /usr/home/permanent/domains/pwinsw.org.au/public_html/photos.php on line 431
And now the website appears to take the time to load the images, the path is correct etc., but they are all "Not available".
Something to do with umask?
umask is 022.
Urgently need help:eek:
 
You should take a look at your httpd error log it might give greater details on what is happening.

The directory it is complaining about is:

corporates/111

make sure they both have the right permissions
 
Last edited:
What is an httpd error log and where do I find it?

The directory corporates/111 has the same permissions as all the others, 755. But it is acting as if secretly it had another permissions set.
 
Did you check the ownership of the directory? Is there a .htaccess file in the directory that might be causing the issue? To view your Apache error log, do the following:
  1. Log into DirectAdmin.
  2. Make sure you are at the User Level.
  3. Click on the Site Summary / Statistics / Logs link.
  4. You should see the Apache error log listed on that screen and can view it from there.
Hope this helps.
 
Thanks, I found the error log file.
It doesn't make much sense to me.
There are a lot of lines like this:
[Tue Jan 22 14:57:19 2008] [error] [client 58.168.80.243] File does not exist:
followed by a path and filename, but the path is correct and the file does definitely exist.

Every second such line refers to one of the image files, and the alternating line is the same except it refers to a file called 404.shtml ... which I've never heard of and it isn't in the script.

Then there are a few lines like this
[Tue Jan 22 15:04:14 2008] [error] [client 58.168.80.243] (13)Permission denied: access to /blah/blah/picture.jpg failed because search permissions are missing on a component of the path
and these lines alternate with one refering to 403.shtml ... which I've never heard of and it isn't in the script, either.

Any clues? Thanks.
 
The 403.shtml and 404.shtml files are just error pages. See http://www.site-helper.com/misc.html#404 for more info about custom error pages. Did you check the ownership on the files to make sure they are correct? They should probably be username:username, where username is the username of the account that owns the domain. However, they might be owned by the apache user. If so, that might be causing your problem, but I cannot guarentee that.
 
Thanks, that link is handy.
I looked in the file management section and for all of the pathways and dirs/files in question the UID is listed as the account owner's username and the GID is listed as apache.

So why do I have the situation where there seem to be two sets of permissions ... the ones I set via my FTP program are getting over-ridden by something else :confused: !!!
 
I have a similar problem with my hostingprovider.

A home-made script (very basic) checks if a directory is writable with is_writable() and if not it will go to the chmod ($file, 0777). That's it... And my provider has no clue on why it won't work on their server.
They even suggested to move my account to anohter provider... Somehow I get the feeling that they want to get rid of me :confused:

The service they provide is very good, so I was hoping someone else has the same problem as I have. And hopefully also has the solution so I can continue my development :D

Thanks in advance!
 
Back
Top