May 23 2009
Posted by Webmasters-central.com as Internet Marketing
1. Always make sure your folders are given 755 permissions (with index file in it) OR 711 permissions. 711 gives Access denied error.
2. Most of the cgi scripts that run under your cgi-bin needs to be chmoded 755 to make them world executable.
3. Some cgi/php scripts need to chmod 777 for the folders. This is because the server needs permission to write on your files. For example you have a membership form where your visitor fills the form. When the form is submitted by the user, the script process the data and writes the user info to your database files. So in this case you have to keep 777 permissions to some script folders.
Here is the tricky part … On some servers scripts run under USER ID. Means they can be writable under user account. In this case there is no need to chmod folders/files to 777. It is a good thing. If you don’t know your server API, ask your host this question – “Is my server API is Apache or CGI Binary?”. If your host tells it is CGI Binary, then your scripts run under your user id.
4. Here is a little script to make you understand better about file permissions:
r means Read.
w means Write.
x means Execute.
Owner means YOU.
Group means that the owner belongs to.
Other means all others.
As a owner you need to read, write and execute the files.
As a group certain web server applications or people need to read and execute your files.
As ‘others’, the whole world needs to read and execute your files.
Most common file permissions:
Files: 644
Folders: 755
Images: 644
CGI scripts: 755
Php scripts: 644
Sometimes you need to chmod the folders or files to 777 to make them writable by the ‘Others’ though this is not advised.
Here is a web site that explains the permissions:
http://www.zzee.com/solutions/unix-permissions.shtml
RSS feed for comments on this post · TrackBack URI
Leave a reply