finally a bnode with a uri

Posts tagged with: sqlite

How to add a missing SQLite extension to an existing PHP system (CentOS)

Creating an module for your existing PHP setup.
So I happily managed to upgrade my VServer to PHP 5.3. However, this did not enable SQLite 3 to be accessible from PHP. Luckily, I was not the only one facing this problem, and Mike Creuzer's answer on Stack Overflow worked for me almost without any changes. Here is the variation that worked on my 1&1 VServer:

The server didn't have the needed compiler, had to install gcc first:
yum install gcc
I had to install/update the php-devel package to enable extension building:
rpm -Uvh
yum --enablerepo=webtatic update php-devel
I needed a different PHP version ("php --version" will tell you which):
tar zxvf php-5.3.6.tar.gz
I wanted SQLite version 3, not 2:
cd php-5.3.6/ext/sqlite3
The rest was basically identical then:
make install
I created the extension file for SQLite3 (/etc/php.d/sqlite3.ini), added a pointer to the, and now (after restarting Apache) SQLite 3 is available via PHP's PDO interface. Stack Overflow++ :)

SeeAlso: CentOS locale issues.

Upgrading an outdated CentOS-VServer to PHP 5.3 with JSON enabled

A very easy way to switch from a restricted PHP 5.2.6 to PHP 5.3.6 without destroying Plesk.
I'm slowly migrating my servers away from 1&1 to DomainFactory, a more modern hosting provider here in Germany. Slowly, because 1&1 has long-running contracts and I will have to keep a few machines until the end of the year.

So I still have a spare 1&1 VServer running a slightly outdated CentOS 5.4 or so which I would like to use for site previews and tests. Among other things, I'm exploring the possibilities of a simplified lib for Semantic Web development, which involves some of the newer features of PHP 5.3 in combination with JSON-based data processing (and possibly SQLite). Unfortunately, my VServer didn't provide either, and the server initialization panel doesn't offer any current OS, possibly due to the bundled Plesk.

Although I did manage to upgrade either CentOS or PHP via yum, each time I ended up with a broken Plesk. Day-long story shorter: I eventually found a nice and simple guide at that worked just fine. The trick is to keep the CentOS as-is (Plesk apparently has issues with certain versions of SSL) and to update PHP with 5.3 packages that still use the pre-5.3 naming scheme (i.e. "php-common" instead of "php53-common" etc.). This way you won't get module and dependency conflicts; the new PHP is just handled as a basic update :)

Here is a quick summary of the commands needed (via webtatic):
rpm -Uvh
yum --enablerepo=webtatic update php
And that's it. The only thing still missing is SQLite, which I didn't manage to get to work. The PDO extension is there, but PHP itself was initially configured as '--without-sqlite3'. For SQLite experiments, I will probably try JiffyBox, which I played with a little yesterday and which looks very promising.

Update: SQLite is now working, too.


No Posts found