WSN Knowledge Base
Featuresspacer Showcasespacer Reviewsspacer Demosspacer Purchasespacer Manualspacer Support
CHMOD and Installation Troubleshooting
CHMOD and Installation Troubleshooting
By Paul

On Windows systems most people are familiar with, anyone can run a file or read a file or overwrite a file. Unix is different, in that it splits up these common permissions according to who's trying to perform the action. There are three possible types of people attempting to perform such an action: the owner of the file, someone in the same user group as the owner, or a stranger who can be classified by the catch-all 'other.'

The permissions scheme is often written in a numeric form to save space. This is done by assigning the value 4 to 'read', the value 2 to 'write' and the value 1 to 'execute.' The result of summing these is a unique number from 0 to 7 describing what can be done with the file. Since there are three groups to deal with, there are three such sums. Suppose we want to let the owner do anything with the file, let the group read and write it, and let others only read it. These permissions sum to 7, 6 and 4 respectively. To describe the permissions for this file, we would say 764.

WSN Knowledge Base attempts to set these permissions for you automatically, but if php is running in safe mode it's not allowed to. Thus you may need to chmod some files and directories. The instructions will tell you to chmod templates to 666 to be able to edit them online. 666 means that user, group and other all get read and write access. This is neccesary because PHP is not considered by Unix to be the owner of your files, it falls under the category of 'other.' The server's default permissions assigned to files you upload do not allow 'other' to write to your files. Only you, logged in by FTP, are the owner -- and thus only you can alter the permissions to give write access to PHP. There is no need to give execution access for templates since .tpl files are not executables -- however it will not harm anything to chmod to 777 (except on some odd web hosts as noted towards the end of this article). You will also be asked to chmod directories such as your /languages/ and /attachments/ directories to 755 or 777. These permissions allow the necessary group to execute and let everyone read and write.

Often, people installing WSN Knowledge Base will end up chmoding their templates directory to 666 -- perhaps misreading the instructions which say to chmod the files to 666. When a directory is set to 666, it becomes useless and as good as deleted. This is because for a user (such as php) to find out what files are in a directory or access those files it must be able to execute the directory. Think of directories as being special files which have to be executed to give access to sets of other files.

If on installation you get a message such as "you don't have any template sets installed", it's almost certain that your templates directory has been chmoded wrongly. To fix it, you must give PHP the ability to execute the directory (and any other directories, such as perhaps /templates/default and templates/styles, which you may have chmoded). You must also of course allow read access. It is not neccesary to allow PHP to write to the directory unless you want to be able to create custom templates online, so 555 would be a valid value to chmod to. 755 however is the best permission to set to if you want it to be possible to upload a file there. For the /languages/ and /attachments/ directories you do want to allow files to be copied or uploaded there, thus they should be chmoded to 755 or 777.

Some hosts don't allow chmoding to 777, and give errors when you try... these are typically 500 "no permission" errors. In these cases chmod to 755 instead.

A summary of what WSN Knowledge Base requires you to CHMOD if you're on a Unix host and PHP doesn't have permission to do the CHMODing for you:

config.php: CHMOD to 666
searchlog.txt: CHMOD to 666 (optional, only needed for search logging)
/languages/ directory: CHMOD to 755 or 777
/attachments/ directory: CHMOD to 755 or 777
whichever language .lng files you're using: CHMOD to 666
whichever template .tpl files you'll be editing online: CHMOD to 666

Rating:


4.78/5 based on 9 votes. The median rating is 5.

Submitted: 11/19/03 (Edited 05/19/04)

Description: For those unfamiliar with how chmoding works, and anyone who gets a 'no permission' error when attempting to view /wsnkb/templates/ in their browser.

Views: 4698 views. Averaging 3 per day.
In the most recent 30 day period, there've been 14 views.

Previous Article | Next Article


Home    |    Features    |    Showcase    |    Reviews    |    Demos    |    Purchase    |    Manual    |    Support