Today I will describe you, how you can install the PEAR Framework on your shared hosting server or other servers.
In this post I wrote how to install Apache and PHP. I installed PEAR on this testerver too. My document root is
/usr/local/httpd/htdocs. If you don’t know your document root make a little php-script with this code and browse it with your favourite browser.
<?
echo $_SERVER["DOCUMENT_ROOT"];
?>
Now if you know your document root on your server, you can beginn to install PEAR.
- Go to http://go-pear.org (important: without www). You can see a source code from a php script. Save this file as pearinstaller.php
- Create a new folder for PEAR on your document root e.g. _pear.
- Chmod your PEAR directory on your webserver with
chmod 777 - Now put the downloadet pearinstaller in the _pear directory.
- Browse to this script with your webbrowser. e.g http://www.domain.tld/_pear/pearinstaller.php
- You should see the Installer Frontend. Click on the next-button.
- On the next site you have to configure your pearinstaller. In the field “Installation Prefix” should now stand something like this:
/path/to/your/documentRoot/_pear - Replace in the fields 4-7
$php_dirwith
$prefix - Start the installation. At the end of the installation you get a link. Click on it and you will come to the web frontend of the PEAR Installer
- The last step: You have to change something on the configuration mask.
PEAR documentation directory: => /path/to/your/documentRoot/_pear/docs
PEAR data directory: => /path/to/your/documentRoot/_pear/data
PEAR test directory: => /path/to/your/documentRoot/_pear/dtests
Approve it by clicking the Go!-Button
Now the PEAR Installer is installed now on your system. With the Web Frontend you can install and delete packages.
IMPORTANT: Delete the
pearinstaller.phpand protect the installdirectory with a
.htaccessfile
Resources: