Labels

Sunday, July 15, 2012

Adding PHPExcel PEAR Library in Shared Hosting Environment

You need to have the PEAR library installed in your shared host/server before this. If you haven't done so, you can check out my earlier post on how to do this.

The Steps I used:

You can download the PHPExcel here. Choose the PEAR version. As of now, the current version is 1.77 and the file size for the .tgz file is 11.7MB.

Extract the .tgz file. You'll see a PHPExcel.php and a PHPExcel folder. Like other PEAR add-ons, you just need to copy the PHP file and the folder to your PEAR root directory. You can find out the root directory during the installation of PEAR. You can also refer to my earlier post on this.

Upload the above mentioned PHP file and its folder to your shared server.

As for the RELATIVE_PATH_TO_YOUR in red above, RELATIVE is the key. If you PHP file is in a subdirectory and your PEAR's root is in another subdirectory, you need to find a path to refer to PEAR. For example, if your testPHPExcel.php is in the /test directory and your PEAR is in /PEAR directory, you'll need this relative path such as ./../PEAR/.