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.
| Files and directories | To make the development and learning of PET easier, PET uses a fixed directory structure. |
| The directories | The two most important directories are $BASEPATH and $DOCUMENTROOT. |
| Permissions | In general, all files and directories should have the same permission as the user you are runing PET under. |
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) :
| html | your documentroot -- the (virtual)host root directory your webserver sees |
| sessions | needed if you need disk based sessions (this dir is pretty much optional -- and you might even store your sessions elsewhere) |
| compiled | if you plan to compile your templates to disk, the will be stored here (recommended) |
| modules | if you use the MVC model, you probably want to store your modules here |
| scripts | if you want to create scripts associated with your applications, this is the recommended place (optional) |
| cache | disk based cache (recommended -- some modules need it) |
| logs | this pretty much optional directory can be used to store your webserver logs (many might not like the idea) |
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.