At my job, I have recently been between projects. I have recently discovered PEAR which the concept of a library of PHP classes is something that I have wanted. I wanted to install these classes on the school’s server. Since I cannot add packages to the main repository I took to following the directions on creating an individuals repository using the directions for doing exactly that on a shared host.
The directions worked as described on my personal web server; but the directions did not work on the UMBC’s server. Here are a list of things I did to get it to work:
- The pear command did not work from command line. To find where it was located I did some searching. I started from where I knew PHP was located by using provided by
php_info()and I found the pear program located in the bin directory. To make simpler for myself, I added the location of pear to my path environment variable. - To figure out what version of PEAR you are using, run the command
pear –V. - The pear directory was not being created when I would run the command. The pear directory should have been in my home directory because it was specified there with the shortcut “
~/” but since it was not I used the full path to my home directory which then created the pear directory where it I wanted it. - I first located the PEAR repository directory in my home directory and I got the following errors in the PHP files: “
Fatal error: main(): Failed opening required '<package>'…”. I discovered PHP did not have group permissions to access my home directory so I placed the repository in my web directory as a quick and simple fix.