Installing Drupal GeSHi Filter Module
The installation of the Drupal 6 Generic Syntax Highlighter (GeSHi) module is of course trivial and wouldn't be worth further consideration if it wasn't for its dependency on the GeSHi PHP Library. Every time I come to install a new PHP library on my rig I am always faced with remembering (a) where the PHP configuration file is so it can be edited with a new path, and (b) where to stick the new library on my filesystem.
So first go to http://qbnz.com/highlighter/ which is the homepage of PHP GeSHi and download the latest 1.0.x release. Don't download anything from the 1.1 branch because the Drupal module will not work with that version. My system automatically copies downloaded files to /tmp
Now lets find that elusive php.ini file.
# find / -name php.ini
/etc/php5/cli/php.ini
/etc/php5/apache2/php.iniTwo php.ini files have been located. The first is for the command line version of PHP - not something I use - I tend to do my command line work using Perl and Shell Scripts. The second is the webserver version, and obviously the one used by Drupal. So that's the one we will need to look at.
Search the file for include_path - this will give you a list of all the directories PHP searches for libraries. On my OpenSuse 11.1 system there are many entries but the most relevant is /usr/share/php5 and we will install the PHP geshi library under that directory. So copy the downloaded library from /tmp, make a directory and unzip into this new directory.
# cd /usr/shae/php5
# cp /tmp/GeSHi* .
# bunzip2 GeSHi*
# tar xvf GeSHi*Back to editing that php.ini file. We need to add an extra path to the include_path along the lines of :/usr/share/php5/geshi
Note the leading colon acting as a delimiter. Once you ave done this, reboot your apache server. On OpenSuse, use:
# /etc/init.d/apache2 restartThe PHP GeSHi library is now good to go. Complete the job by installing and configuring the Drupal GeSHi module in time honoured fashion.