Files and directories

To make the development and learning of PET easier, PET uses a fixed directory structure.  This document explains what directories and files are needed, and how to create them.

Summary
Files and directoriesTo make the development and learning of PET easier, PET uses a fixed directory structure.
The directoriesThe two most important directories are $BASEPATH and $DOCUMENTROOT.
PermissionsIn general, all files and directories should have the same permission as the user you are runing PET under.

The directories

The two most important directories are $BASEPATH and $DOCUMENTROOT.  The former is the root of all actual PET installations (sites), while the later is a subdir of $BASEPATH which is name “html” and which must be the same as the DOCUMENTROOT configured in your webserver.  Imagine something like this :

$USERHOME/
... nameofyoursite/ <= this is $BASEPATH
........ html/      <= this is the $DOCUMENTROOT
........ cache/
........ sessions/
........ compiled/
........ modules/
........ scripts/
........ logs/

Actually only “html/” is really necessary.  However, the other directories might also be needed (depending on your configuartion mostly) :

htmlyour documentroot -- the (virtual)host root directory your webserver sees
sessionsneeded if you need disk based sessions (this dir is pretty much optional -- and you might even store your sessions elsewhere)
compiledif you plan to compile your templates to disk, the will be stored here (recommended)
modulesif you use the MVC model, you probably want to store your modules here
scriptsif you want to create scripts associated with your applications, this is the recommended place (optional)
cachedisk based cache (recommended -- some modules need it)
logsthis pretty much optional directory can be used to store your webserver logs (many might not like the idea)

Permissions

In general, all files and directories should have the same permission as the user you are runing PET under.  The “logs” directory might need other permissions -- that of your webserver -- if you chose to use it.

It is very important that the “html” directory should be readable by your webserver.  Either make all files readable for everyone, or put your user in the group of your webserver.

Close