show_lol
show_lol

Reputation:

Unable to set chmod 640?

I just installed phpbb on my website. According to phpbb advice, I was suppose to set the config.php chmod to 640. In filezilla(my ftp program), I tried right-click the file, then select file permissions to 640, but it gives me this error:

500 'SITE CHMOD 640 config.php': command not understood

How do i change the chmod? I am using windows OS...

EDIT: My server is Windows Server 2003

Upvotes: 1

Views: 2999

Answers (4)

JimG
JimG

Reputation: 1782

Must've missed your edit. Mode 0640 is pretty meaningless to Windows. The advice to set it that way applies to Unix-like systems. It means that the owner is the only person who can change it, and the group can read it, and that's it. For your system, just make sure it's not writable by non-admins by setting appropriate ACLs (file properties, security).

Upvotes: 0

Brian Clozel
Brian Clozel

Reputation: 59191

JimG is right - we don't know your type of hosting or FTP/SSH restrictions.

Quickest solution:

<?php
chmod("/home/youruser/yourwebsite/config.php", 0640);
?>

Hope you won't run into owner/group permission problems; in that case, you'll have to handle it with more chown and chgrp function calls.

Upvotes: 2

JimG
JimG

Reputation: 1782

Sounds like the FTP server doesn't support chmod. Do you have any alternative access methods (e.g. ssh)?

As an amusing fallback option, create a php script that sets the permissions via PHP's chmod function and then browse to it.

Upvotes: 1

Thorbj&#248;rn Hermansen
Thorbj&#248;rn Hermansen

Reputation: 3552

What kind of enviroment is the site hosted in?

If linux: Can you log in via SSH to the server? (Putty is a good SSH client for Windows). Once you are inside, change directory to where the config.php is and type the chmod commnad there.

Upvotes: 1

Related Questions