Fork me on GitHub

The Wp-Syntax plugin for WordPress provides syntax highlighting for WordPress blogs via the GeSHi PHP syntax highlighter. Unfortunately, the plugin includes a builtin version of GeSHi (currently in geshi/. As a result, not only are users of the plugin not instructed to use the latest version of GeSHi, but it won’t use a host-wide GeSHi installation that’s already in the PHP include path (i.e. /usr/share/php/), like the the many php-geshi packages offered by repositories including EPEL (for Fedora, CentOS and RHEL).

The fix is quite simple. Just open wp-syntax.php in the wp-syntax/ plugin directory in your favorite text editor and change the GeSHi include line (for WP-Syntax 0.9.12, this is line 53) from:




If you already have GeSHi installed in the PHP include path, just remove the geshi directory in your wp-syntax/ plugin directory, flush the WordPress caches (if any), and load a page which uses GeSHi - it should now use the host-wide version. If you want to still use a local version for wp-syntax, you can move things around to where they should be in the wp-syntax/ plugin directory:

mv geshi/geshi.php . && mv geshi/geshi/* geshi/ && rmdir geshi/geshi

Note - if you’re in a shared hosting environment, or are otherwise not able to upgrade the php-geshi package on your server yourself, you might not want to do this.

I also posted about this in the WordPress support forums. Hopefully the WP-Syntax devs will include this change in the next version…


comments powered by Disqus