page content
How do I set the permissions on my PHP and HTML files ?
As you don't have shell access you have to do this from within your FTP client program with which you upload your files.
Most of the simpler FTP clients offer a graphical attribution of the permissions:
user group world
read () () ()
write () () ()
execute () () ()
you just have to click to grant the rights. As you can recognize the holder of the rights becomes less and less trustworthy: the user rights are for yourself, the group rights are for the groups you are a member of and the world are the visitors of your website.
As you are no group's member consider the group and the world as the entities that you have to grant very carefully rights to.
For a very simple PHP script you would grant for instance these rights:
user group world
-rw --r --r
A good practise is to use always as few permissions as possible. The above example could be also written in octal values, like this:
user group world
-rw --r --r
would be 644
Putting it simple: you choose from 0-7 for each of the three groups, user, group and world.
0 means no access right at all
1 means execute rights (be careful)
2 means write rights (be careful)
4 means read rights (that's the only right needed for standard HTML files)
If you add the octal values together you combine the rights, for instance 1+2=3 3 means execute and write rights.
You may play around with these rights in your directory to better learn how to use them. Don't forget to always verify the rights you set. An error could be fatal to your content's security.
For your common HTML and PHP files you would grant only 644 permissions. This means that you, the user has read and write rights (4+2=6); the group has read rights (4) and the world has read access too (4); (sumed up this makes: 644). Generally your FTP client uses these careful permissions as default.
comments
add your comment
comments add advicecontact us
the comments
25th of July 2006 at 17:28 | posted by man
rfsdfsfsd sqf sqf qd q sfqsfd qsf qsfd qs
30th of October 2012 at 20:58
comment awaiting validation.
2nd of November 2012 at 22:48
comment awaiting validation.
18th of November 2012 at 15:27
comment awaiting validation.
20th of November 2012 at 11:27
comment awaiting validation.
20th of November 2012 at 18:52
comment awaiting validation.
22nd of November 2012 at 7:05
comment awaiting validation.
23rd of November 2012 at 7:58
comment awaiting validation.
23rd of November 2012 at 12:43
comment awaiting validation.
23rd of March 2013 at 15:18
comment awaiting validation.
27th of January 2015 at 17:28
comment awaiting validation.
11th of August 2016 at 22:32
comment awaiting validation.
22nd of August 2017 at 20:39
comment awaiting validation.
1st of September 2017 at 7:01
comment awaiting validation.
4th of September 2017 at 11:08
comment awaiting validation.
11th of September 2017 at 16:22
comment awaiting validation.
26th of September 2017 at 17:38
comment awaiting validation.
3rd of October 2017 at 13:37
comment awaiting validation.
29th of November 2019 at 23:10
comment awaiting validation.
1st of December 2019 at 2:45
comment awaiting validation.
1st of December 2019 at 12:00
comment awaiting validation.
3rd of December 2019 at 10:53
comment awaiting validation.
5th of December 2019 at 5:16
comment awaiting validation.
14th of December 2019 at 20:48
comment awaiting validation.
15th of December 2019 at 15:38
comment awaiting validation.
16th of December 2019 at 13:23
comment awaiting validation.
18th of December 2019 at 9:35
comment awaiting validation.
5th of January 2020 at 3:51
comment awaiting validation.
4th of April 2020 at 18:24
comment awaiting validation.
12th of July 2020 at 1:43
comment awaiting validation.
5th of October 2021 at 10:04
comment awaiting validation.
19th of April 2022 at 6:53
comment awaiting validation.