Installing packages manually is no recommended way, but a lot of people run into problems using the automated ways, when their sites are located in web hosting environments with no shell access.
In the following paragraphs, we will demonstrate how to install packages manually on a site with the following path scheme: The document root of the site is /var/www/www.example.com/htdocs/. On the same level than htdocs there is another directory called includes. This directory can not be accessed via HTTP but via FTP or WebDAV.
The installation consists of some easy to follow steps:
Download the package:
You can download the package from the PEAR homepage with your web browser. If you do not know the URL of the package information page for the package, you can use the package browser to view the currently available packages.
Upload the package source code
After having downloaded the .tgz file of the package, you have to extract the contents of the archive file to a temporary directory on your local machine. After that you must upload the source code via FTP, WebDAV or another method to the directory /var/www/www.example.com/includes/, so that the source code for Mail_Mime now e.g. resides in /var/www/www.example.com/includes/Mail/.
Adjust your include_path directive.
Now you have to adjust PHP's include_path directive so that it contains the location where you just uploaded the source code. If you have access to the php.ini configuration file for your site, you have to add /var/www/www.example.com/includes/ to the directive there. If you do not have access to the configuration, you have to set the include_path in each script where you want to use the package:
ini_set("include_path", '/var/www/www.example.com/includes/' . PATH_SEPARATOR . ini_get("include_path")); |
After having finished the installation, you can now make use of the package:
require_once "Mail/Mime.php"; $mime = ... |
If you have more questions concerning manual installation, you can ask on the user mailing list.