Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I thought this was PHP related when I started out, but maybe it isn't. My original post, which may be irrelevant now is located at the bottom. I think it should be ignored.

The problem is I have a directory : /articles/. In it are 10 sub directories. I have been changing the permissions lately, but now it seems all the permissions of the parent folder, sub-folders and files are either chmod 755 or 777.

I cannot move, delete or edit files inside of this parent directory or sub-directories with my FTP-client. I can however edit, delete, create new files and directories and change them with PHP-functions without problems.

What may the problem be?

EDIT 3: My hosting company fixed the problem and said it was because of permissions + ownership. I checked these things as thoroughly as I could, so it makes no sense to me, but I suppose they are right.

OLD POST. Ignore everything below this line:


If I create a directory with mkdir(), or create a file with fopen(), file_put_contents() or SimpleXMLElement::asXML(), I am unable to access the file with my FTP-client or c-Panel File Manager. If I try to delete or edit them, I get errors. Dreamweaver suggests it is a permission problem or a network or filesystem fault (but I've set the permissions with chmod() to 0777, and when I check the cPanel, it confirms chmod 777. I also tried to use fileowner() and the function returns int(99), the same owner as those files that I could access with my FTP-client. It seems files and directories created with PHP can only be modified or be deleted with PHP. I thought this must be a server setup related issue, so I write it here. I am on a shared server, and I have no idea about setting up servers. EDIT: It seems the problem is different. I cannot move files with FTP-client to the parent, or sub-directories either. This problem may not be PHP related, then. It seems the problem applies to any directory, regardless of whether it was created by PHP. EDIT 2: The parent directory has chmod 755.


Thank you for your time.

Kind regards
Marius

share|improve this question

2 Answers 2

Does directory containing these files also have appropriate permissions? I'd imagine that you'd have checked that already, but can't tell specifically how far you've gone with testing from your post.

share|improve this answer
    
Written an update. It seems the problem may not be related to PHP at all.M –  user43053 May 13 '10 at 20:21

Perhaps your FTP configuration is set to have that directory (or the user that you're accessing from) set as read-only?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.