pear:php extension and Application Library

Source: Internet
Author: User
Tags add config install php include pear php and php code version
1. Pear Introduction
pear:php Extension and Application repository,php extensions and application libraries. (Suddenly want to eat pears) Pear's Mission: To provide reusable components to lead the innovation of PHP. Provides packages and applications for PHP code. Pear is also the PHP code standard, making PHP code easy to read and improve reusability.
2. Pear Installation
When you install PHP, pear is installed by default, in the Bin directory. View the version number by using the versions parameter.
$./pear version

pear version:1.9.4
PHP version:5.4.26
Zend Engine version:2.4.0
Verify that the extensions for PHP include path pear are installed under PHP's include path.
$./pear config-get Php_dir

/home/gang/php/lib/php

3. Pear Parameters
Run directly pear will output its arguments
$./pear

Commands: Build builds                  a Extension from C Source
bundle                 unpacks a Pecl Package
Channel-add            Add a channel
channel-alias          Specify an alias to a channel name
channel-delete         Remove A Channel from the List
...

Common parameters: Info View package Information Install installation package Uninstall Uninstall Package List view locally installed packages Remote-list View the packages on the line
Upgrade Upgrade Package Config-show View config configuration

Using Help to view common parameter usage
$./pear Help Install

4. Install PHP package
Like we're going to install log logs.
$./pear Install LOG
After successful operation, the log.php and log directories are generated in the Php/lib directory, and the doc directory is used under Doc/log for examples and instructions.
Upgrade Log Package:
./pear Upgrade LOG

5. Use of installation package
In the above we install the log package. In the application of the PHP code require come in.
 
  Log ("Log entry $i");
}

6. Commonly used PHP packages
phpdoc– Document Extraction Tool
phpunit– Unit Test Framework
db– Database Encapsulation
All can be viewed by using the command:
$./pear remote-list



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.