The PHP ClearSilver extension by my friend and colleague Homme Zwaagstra enables you to use the ClearSilver template language in conjunction with PHP.
This document covers installation of the ClearSilver module on Debian based systems. I am by no means a guru at these kind of things (seriously, I a lot of this is guess work), but I'm fairly sure that these instructions should work. I've only done this on my Ubuntu system, but I can't see why it wouldn't work on any Debian based distribution.
Please read the current PHP ClearSilver module documentation before tinkering with your system.
Before hacking on the ClearSilver module, please contact Homme as there is a newer version that has been developed, it just isn't on the internet.
The ClearSilver PHP module is not considered stable for production environments. Following these instructions could result in all kinds of problems. Neither I, nor anyone but yourself will be liable if anything goes wrong: you have been warned!
Note, your paths will probably vary slightly to mine. Do not just follow these instructions blindly, think a little!
First we'll get the various bits and pieces needed to build our ClearSilver module:
apt-get build-dep php5 apt-get install dpkg-dev php5 clearsilver-dev
Next, we'll get the php5 source and put it in /tmp/
cd /tmp/ apt-get source php5
Now, download the clearsilver targz from http://www.geodata.soton.ac.uk/software/php_clearsilver/ and extract it's contents into /tmp/phpx-x/ext/clearsilver/ where phpx-x is your php source directory.
Edit your /tmp/phpx-x/debian/rules file with your favourite text editor and add the following line with the second lot of –with-stuff lines (should be two lots):
Ok, the module is now ready for compiling, in the root of the php source dir (/tmp/phpx-x/) you will probably need to be root to do this:
dpkg-buildpackage -b -uc
-b means binary packages only, don't remake the source. -uc is don't bother signing the changes file.
This should take a fair amount of time to compile! Go and make a nice cup of tea, or try coffee - a great alternative to tea.
If all went well (fingers crossed), you should have a whole bunch of new .deb files in /tmp/. As root, use dpkg -i to install the packages, like so:
dpkg -i php5-common_5.2.3-1ubuntu6.2_i386.deb dpkg -i php5_5.2.3-1ubuntu6.2_all.deb
I've found the modules don't seem to actually get copied over from the source directory, so I've had to do this manually, like this:
cp /tmp/phpx-x/apache2-build/modules/*.so /usr/lib/php5/20060613+lfs/
Next we need to tell php to actually load the ClearSilver module, so open /etc/php5/apache2/php.ini in your editor and in the section labelled 'Dynamic Extensions' add the following line:
extension=clearsilver.so
You'll also need to set or alter extension_dir like this in php.ini:
extension_dir = "/usr/lib/php5/20060613+lfs/"
You could just plonk your newly create .so modules anywhere and tell php to load them from there - up to you really, I just hacked it up as I had work to get on with!
Restart apache:
/etc/init.d/apache2 restart
Remember to lock the version of php5-common_xxxx.deb and php5_xxxxx.deb using synaptic or whatever so that your custom versions don't get overwritten if you do an apt-get upgrade.
If you have any comments, suggestions, tweaks or completely new set of instructions, please email them to me at: johnrhunt _-A T-_ gmail.com
Like I said before, I'm no guru, but these tips should help give you a fighting chance at getting it working.
Homme's ClearSilver extension is under development, and a new version should be out soon.