Setup - GeSHi/geshi-1.0 GitHub Wiki

Requirements

GeSHi requires the following to be installable:

  • PHP. It should be at least version 5.4 but higher versions are really recommended.
  • Approximately 2 megabytes of space. The actual script is small - around 150K - but most of the size comes from the large number of language files (over 100!). If you’re pushed for space, make sure you don’t upload to your server the src/docs/ or src/contrib/ directory, and you may want to leave out any language files that don’t take your fancy either.

As you can see, the requirements are very small. If GeSHi does NOT work for you in a particular version of PHP, please open a bug report.

Downloading GeSHi

FIXME this section needs to be rewritten

Extracting GeSHi

Packages come in .zip, .tar.gz and .tar.bz2 format, so there’s no complaining about whether it’s available for you. *nix users probably want .tar.gz or .tar.bz2 and windows users probably want .zip. And those lucky to download it directly from SVN don’t even need to bother extracting GeSHi.

To extract GeSHi in Linux (.tar.gz):

  1. Open a shell
  2. cd to the directory where the archive lies
  3. Type tar -xzvf [filename] where [filename] is the name of the archive (typically GeSHi-1.X.X.tar.gz)
  4. GeSHi will be extracted to its own directory

To extract GeSHi in Windows (.zip):

  1. Open Explorer
  2. Navigate to the directory where the archive lies
  3. Extract the archive. The method you use will depend on your configuration. Some people can right-click upon the archive and select “Extract” from there, others may have to drag the archive and drop it upon an extraction program.

To extract from .zip you’ll need an unzipping program - unzip in Linux, or 7-Zip, WinZip, WinRAR or similar for Windows.

Installing GeSHi

Installing GeSHi is a snap, even for those most new to PHP. There’s no tricks involved. Honest!

GeSHi is nothing more than a PHP class with related language support files. Those of you familiar with PHP can then guess how easy the installation will be: simply copy it into your include path somewhere. You can put it wherever you like in this include path. I recommend that you put the language files in a subdirectory of your include path too - perhaps the same subdirectory that geshi.php is in. Remember this path for later.

If you don’t know what an include path is, don’t worry. Simply copy GeSHi to your webserver. So for example, say your site is at http://mysite.com/myfolder, you can copy GeSHi to your site so the directory structure is like this:

http://mysite.com/myfolder/geshi/[language files]
http://mysite.com/myfolder/geshi.php

Or you can put it in any subdirectory you like:

http://mysite.com/myfolder/includes/geshi/[language files]
http://mysite.com/myfolder/includes/geshi.php

FIXME explain install by composer

:exclamation: Caution:

When using GeSHi on a live site, the only directory required is the geshi/ subdirectory. Both src/contrib/ and src/docs/ are worthless, and furthermore, as some people discovered, one of the files in contrib had a security hole (fixed as of 1.0.7.3). I suggest you delete these directories from any live site they are on.