]>
For some time I have considered the possibility of getting my favourite CMS running within OpenLink's Virtuoso Universal Server. But I always managed to put myself off the project because there seemed too many pieces of the jigsaw to put into place first
Finally, last month I decided to get it done. And now it mostly is. This page is served to you by Joomla! 2.5 running entirely within Virtuoso Open Source Edition v6.1.6, with only a handful of minor SQL hacks going on in the "driver" (all of which should soon be dealt with and merged upstream in Joomla! CMS). But what was the point? I'll tell you... only later when I find time to write about it.
First of all, I should make clear that while using Virtuoso for the database is a great idea, using it for the webserver doesn't bring any real advantage. I did that more out of curiosity because I was involved in the original Debian/Ubuntu packaging for Virtuoso and had always intended to get the PHP hosting module packaged until I realised that Virtuoso needs PHP to be built with the "experimental" Zend Thread Safety feature enabled, which Debian currently doesn't do. Well, they did briefly, but let's not open that can of worms.
So that was my first task, to create a php5-zts variant package suitable for Virtuoso. It's not quite 100% perfect yet, but it does the job. I managed to relocate everything in separate paths from the standard PHP5 package to allow them to be installed side-by-side, except that somehow the ZTS version still wants to store session data in the standard /var/lib/php5 path. I'll find out why and fix it eventually, but since there shouldn't be any conflict, it's easily solved for now:
sudo mkdir -p /var/lib/php5
I might as well note here the Debian patches that I dropped for this package, which caused the ZTS build to fail:
It's still on my TODO list to look at those patches and correct them for ZTS builds.
The usual PHP5 package in Debian builds quite a lot of stuff. I couldn't see any purpose for a thread-safe CLI binary or some of the other build types, so I'm only building a DSO library for the ZTS package.
Some things to note about the ZTS feature at this point. First, PHP's thread safety is often disputed. I have seen myself one or two segfaults in Virtuoso since using it to host Joomla! although it's hard to say for sure whether they are due to ZTS or not. In my experience PHP doesn't need much excuse to segfault, it can become quite flaky as soon as you deviate just a little from the typical LAMP stack and common applications. But really it's not half as bad as many technologists would tell you and has numerous redeeming qualities. In any case, the situation is only likely to improve, with CPU makers forever adding more and more cores it's a serious issue for PHP's future.
Second point, it will be marginally slower because of the extra code handling (whatever amount of) thread safety. Hopefully not too much.
But otherwise...it's all working and ready to install from my PPA if you're running Ubuntu 12.04 (Precise Pangolin). I will add other series eventually, but I want to check and improve some things with it first. Install from my Launchpad PPA by your preferred method, or like this:
sudo apt-get install python-software-properties
[installs a handy package for handling PPA repositories]
sudo add-apt-repository ppa:wdaniels/virtuoso-php
[adds my PPA repository for this work]
sudo apt-get update
[reloads the package index to make the new packages available]
With the ZTS variant available in the PPA, that allowed me to add it as a dependency for Virtuoso and configure to build the PHP SAPI module for it's webserver. The resulting module is called libvirtuoso6.1-mod-php5, in line with what I think is the correct Debian naming convention for such things (I would have preferred a more intuitive name).
Initially, I also changed the ODBC module in the PHP5 package to use iODBC instead of unixODBC, in line with OpenLink's instructions. But I later discovered that iODBC is unmaintained and being dropped (unless OpenLink wants to do something to stop that) so I quickly switched that back. Everything still seems to be working fine with unixODBC, as it should anyway.
So while I was at it, I did a little more work on the Virtuoso package:
So to get started hosting PHP scripts within Virtuoso, assuming you added my PPA already, just:
sudo apt-get install libvirtuoso6.1-mod-php5
It should pull in the libphp5-zts dependency, but you will almost certainly want the ODBC module as well to talk to Virtuoso:
sudo apt-get install php5-zts-odbc
You won't get a default php.ini config with my ZTS packages (still on the TODO list) but the defaults will work fine for getting started. Any PHP modules installed via apt-get will get loaded from config in /etc/php5-zts/conf.d but everything else will be at PHP default settings. I would suggest one thing in particular to set:
odbc.defaultlrl = 1000000
[or something else suitably large for your expected data sets]
LRL = Long Read Length. This is because PHP (maybe just the 5.3 version currently used) has a bug — or at least with Virtuoso ODBC driver it does — reading LONG data values via ODBC, which can only be avoided by setting the default read buffer to something large. Setting odbc_longreadlen in code won't help the problem, but you can just use ini_set to change it in code:
ini_set('odbc.defaultlrl', '1000000');
I'll refer you back to OpenLink's PHP hosting instructions hereafter. Note that the ODBC DSN name for the default Virtuoso instance created by the Debian packages is "VOS" instead of "Local Virtuoso" as assumed for OpenLink's document.
Quick start hint: put your PHP files under /var/lib/virtuoso-opensource-6.1/vsp and configure the webserver in "Virtual Domains & Directories" under "Web Application Server" in Virtuoso's "Conductor" application (if you installed it). Else you can set things up via SQL using the isql-vt program.
If you find anything of use or interest here, please consider supporting the Kiva project with a loan. If you don't already have a Kiva account, the first $25 loan is usually free.
I am in the process of rebuilding this website. Please excuse the mess.
If you came here for something I used to publish, check back in a few days.
Anything from the old website that might still be useful will probably reappear, but I want to take the opportunity to check and update everything before migrating it.
Will Daniels is an Independent IT Consultant in Birmingham, UK
I specialise in Knowledge and Data Management using Semantic Web technologies as well as conventional RDBMS systems.
I work primarily with Linux platforms and am also a fair Linux System Administrator.
Presently working at CloudTomo.
https://willdaniels.co.uk/foaf#webid