Installing Calibre PHP


(These are mostly notes to myself!)

I love Calibre, it's the perfect eBook management tool. It comes with a built in WWW server so you can easily access your library on the go. The only problem is that this really only works if you have a single machine dedicated to Calibre. For various reasons, I don't have a single machine.

I have a desktop, laptop, and server. The Calibre Library is just a database with a set of files and folders - so all three machines sync via DropBox. As long as I don't have the Calibre program open on my desktop and laptop at the same time, everything is hunky-dory.

However, having Calibre running on the server buggers everything up. So, I'm using a separate program - Calibre-PHP Content Server.

Installation was relatively simple, assuming you've already got apache and PHP installed, you'll also need GD, SQLite3, and Smarty.

This was how I installed them on Ubuntu

sudo apt-get install smarty php5-gd php5-sqlite php5-sqlite3sqlite3

Configuration is slightly confusing. Copy the config_default.php to config_local.php and edit it.

$config['library_dir'] = '/data/Dropbox/eBooks/Calibre Library';
$config['smarty_dir'] = '/data/smarty-cache';
$config['smarty'] = '/usr/share/php/smarty';

The library directory must be readable to the webserver (chmod a+r) and all the directories above it have to be searchable (chmod a+x).

The "smarty_dir" is where the cache is stored. It needs two sub-folders, smarty_cache and smarty_templates_c. Both of these directories must be writable by the webserver.

That should be it. There's help available at the official help thread.


Share this post on…

What are your reckons?

All comments are moderated and may not be published immediately. Your email address will not be published.

Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <p> <pre> <br> <img src="" alt="" title="" srcset="">