Pear Tutorial (i) Introduction and installation of--pear

Source: Internet
Author: User
Tags manual ini pear php file php code root directory

First please open this link http://pear.php.net/manual/en/Let's take a look at what pear is, click Chapter 1. Introduction.

The PEAR is short for "PHP Extension and application Repository" Andis pronounced just like the fruit. The purpose of the pear is toprovide:pear is the abbreviation for "PHP Extension and Applicationrepository", and the pronunciation is the same as the English word "pear", so you see the logo of this site is a pear.

* A Structured Library of Open-source code for PHP users all PHP developers can use open source libraries

* A system for code distribution and package maintenance is a packaged system for code distribution

* A standard style for code written in PHP, Specifiedhere is a standard for PHP code format

* The PHP Extension Community Library (PECL), and the Morebelow is a PECL

...

In a word, pear is a powerful PHP library, my bloggermap is also used in this library, and the library's package is complete, including the database, form generation, caching everything, I will gradually introduce to you.

Reader requirements: 1. Will build Wamp (window+apache+mysql+php) server. 2. will be simple php3. Willing to use Pear

Here's a look at the installation of pear (this is important):

First of all talk about the path of PHP include, this and Java classpath comparison, there is a default path, such as PHP.ini set a few default path/etc/include or/etc/demo, then in the PHP code, If there is a similar "include ' file.php ';" Contains statements, the program will be executed in the current folder search whether there is file.php this file, if not, and then to search/etc/include or/etc/demo folder whether there is this file, if still not, then the error!

For foreign virtual host, many are installed pear, and the installation of pear package are very complete, so you refer to the PHP file include "pear.php", The program is referenced according to PHP.ini's path to find pear, but if the virtual host does not have pear installed, we have to install it ourselves.

The installation of pear is a very simple process, can not be afraid, below or guide you to see the Help manual, link here (because many people do not know the file structure of pear, so this manual was deleted), but there is no relationship, you can go to this link to see. Probably very few people have the patience to look down, anyway I can not watch, in fact, the most important thing is this line, that is to tell you add PHP default include path method

<?phpini_set(‘include_path’,‘~/pear/lib’.PATH_SEPARATOR.ini_get(‘include_path’));// From PHP 4.3.0 onward, you can use the following,// which especially useful on shared hosts:set_include_path(‘~/pear/lib’.PATH_SEPARATOR.get_include_path());?>

OK, let's start with the installation steps:

First of all, suggest the folder "tutor" in the root directory of the Web site, then set up a folder inc., download pear, and the current version of the download address is http://download.pear.php.net/package/PEAR-1.6.1.tgz.

Download the decompression, put Pear in the INC directory, expanded directory as shown:;

Path to the Includedefine,].define,web_dir.//pear directory

, Pear_dir. Path_separator.? >

Open http://127.0.0.1/tutor/demo.php again and find what? The mistake is gone!

At this point, the pear installation ended

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.