(Note: 777 has pontential security risks and may allow hackers to upload files to these directories to run phishing sites etc. If security of your web site is important, set it these folders to CHMOD 775 or tighter.)
the text added to the documentation by ljbadenz (above) isn't entirely accurate or applicable to most shared hosting environments. i wonder how many people who post questions involving file permissions issues in the forums have used 775 instead of 777 ?!?
This part (steps 4, and perhaps 5) needs to be rewritten for clarity and additional information. I've whipped up a draft here that anyone can butcher if they like before edits get posted to the Wiki. The one thing I need confirmed because I don't use Windows for anything I don't have to.. is the skipping to step 6 for Windows 100% accurate in
all cases?
Step 4.
Note: If you are running on a Windows server, you can skip to Step 6, Database.
For CMS Made Simple to function properly, it needs to be able to write files to certain directories.
CHMOD is a tool on Linux (and other Unix-like) servers for setting file permissions. Most FTP clients allow you to "CHMOD" files (may be called 'file attributes'), so console or shell access is normally not required to change file permissions. Your hosting provider may also have a web-based file manager as part of its control panel (cPanel, H-Sphere, Plesk, etc) for this task.
Ask your hosting provider or server administrator what file permissions to use to ensure the web server process has write access to files and directories. If you are unsure, using 777 works for all cases, but may be a security risk as it allows full access to everyone who gains access to the server to those files or directories.
To ensure write access to directories in most Linux shared hosting environments, 777 are the permissions to use. You would use 666 to enable write access to an individual file. (The difference between a "6" and a "7" is the "execute" bit. A directory must be "executable" in order to be opened, but you don't normally want EVERY file to have this bit enabled, so you would use 666 for files instead.)
Once you've determined the correct permissions to use, CHMOD the following directories to enable write access for the web server process:
- tmp/templates_c
- tmp/cache
- uploads
- uploads/images
- modules
If you do have console or shell access to your web space, you can do this from the Linux command line (executed from your CMSMS site root):
chmod 777 tmp/templates_c tmp/cache uploads uploads/images modules
Tip: You can try running the CMSMS installer without changing file permissions, to see if your own permissions will work (i.e. PHP scripts are run under your own user account instead of the web server's). If they don't work and the installer complains about unwritable files or directories, that is usually a good indicator that 777 (for directories) and 666 (for individual files) need to be used.
Step 5.
CMS Made Simple uses a configuration file to store certain settings that cannot be stored in the database. This file is not included in the distribution archive; it is created during the installation process if the web server can write to the CMSMS site root. Since this isn't normally the case on a Linux shared hosting environment, we'll just create the file and make it writable by the web server process, which covers both possibilities. This also ensures that YOU "own" the file and not the web server (which might have denied your own user account full access to the file).
Using a text editor (not a word processor), create an empty file called "config.php" (without the quotes) and upload it to your CMSMS site root.
If you are running on a Linux (or other Unix-like) server, "config.php" needs to be writable by the web server process. For most shared hosting environments, this means CHMOD it to 666. Refer to step 4 for additional information about file permissions.
If you have console or shell access to your web space, you can do this from the Linux command line (executed from your CMSMS site root):
touch config.php
chmod 666 config.php
To create an empty file in Microsoft Windows, open Notepad to new, empty document and immediately choose File -> Save As. For a filename, use "config.php" (including the quotes, which ensures that the correct file extension ".php" is used instead of ".txt").