Вы находитесь на странице: 1из 2

Setting up PHP Pear In A Shared Web Hosting

Scheme:
I need this for the talktilaok project. We will be getting the contents from the talktilaok US site and mirror it to talktilaok AUS. Our uses counterpart provided us with an RSS feed. Parsing the XML from the feed is needed. In order for me to do that, I will be utilizing XML_RSS()PEAR package (http://www.ibm.com/developerworks/xml/library/x-phprss/) . Since our websites are located on a shared hosting I need to come up with a solution for installing the said PEAR package. Gathering and doing some tests from different information from the Internet (credible sources in the Reference section below), I come up with a this document that is working on the time I was doing the said project.

I.

Verify the include path.


a. To see which php.ini is used but PHP on your web server, create a file with the contents below and save it in your local web root as phpinfo.php. Upload the file and open it in your browser as http://www.talktilaok.com.au/phpinfo.php, to find the path to the php.ini file your web server is using. <?php phpinfo(); ?> b. Check PHPs include_path setting in your web server. In http://www.talktilaok.com.au/phpinfo.php page, check the value of include_path your web server is using. In every case, PEARs php_dir should be in the include path. If not, add it in your systems php.ini. c. Create a new file named check_pear.php file with the following contents: <?php require_once(System.php); var_dump(class_exists(System,false)); ?> Upload the file and access it with your web browser. The page should only contain bool(true)

II.

Install packages.
a. Scheme: The document root of the site is /home/talktila/public_html/. On the same level of public_html there is another directory called includes. This directory cannot be

1/10/2013

accessed via HTTP but via FTP. b. Download the package at http://pear.php.net/packages.php. c. 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 temporary directory on your local drive. After that you must upload the source code via FTP to the directory /home/talktila/includes/ so that the source for Date now resides in /home/talktila/includes/ d. 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 /home/talktila/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", '/home/talktila/includes/' . PATH_SEPARATOR . ini_get("include_path"));

e. After having finished the installation, you can now make use of the package. include ("Date.php"); References: http://pear.php.net/manual/en/installation.checking.php http://pear.activeventure.com/installation.manually.html

1/10/2013

Вам также может понравиться