Skip to content

PHP Application Packaging

I spent some time this weekend packaging Gallery2 and Serendipity for rPath based Linux Distributions. As part of that effort, I built a conary recipe superclass to make packaging other PHP applications easier.

This class currently resides in the LAMP repository in the phpapppackage:source trove. The superclass handles creation of the apache configuration file to drop in to /etc/httpd/conf.d, provides stubs for creating empty files and directories for use by the PHP application, and sets up the requirement on PHP.

So, a new recipe for a simple application like gallery looks like the one here.

Notice the calls to MakeWriteableDirs and CreateWriteable. Those create the empty config files and directories needed by the application. These are created with ownership "apache", as which user the stock httpd server runs. Also notice the r.macros.dirconf macro. This data gets inserted into the apache configuration file between <Directory foo> directives so that you can set application specific php configuration values, or even set overrides.

If you use phpapppackage.recipe as a root class to package some other php application, shoot me an e-mail to let me know. I'd love to hear about it.