How to quickly and automatically install PHP extension modules

Source: Internet
Author: User
Tags pear
  1. wget http://pear.php.net/go-pear

  2. PHP go_pear

  3. [Root@localhost ~]# php go-pear

  4. Welcome to go-pear!

  5. Go-pear'll install the ' pear ' command and all of the files needed by

  6. It. This command was your tool for PEAR installation and maintenance.

  7. Go-pear also lets you download and install the following optional pear

  8. Packages:pear_frontend_web-beta, Pear_frontend_gtk2, MDB2.

  9. If you wish to abort, press control-c now, or presses Enter to continue:

  10. HTTP Proxy (Http://user:password@proxy.myhost.com:port), or Enter for none::

  11. Below is a suggested the file layout for your new PEAR installation. To

  12. Change individual locations, type the number in front of the
  13. Directory. Type ' All ' to change all of them or simply press Enter to
  14. Accept these locations.

  15. 1. Installation prefix ($prefix):/root

  16. 2. Temporary files directory: $prefix/temp
  17. 3. Binaries Directory: $prefix/bin
  18. 4. PHP Code directory ($php _dir): $prefix/pear
  19. 5. Documentation Base directory: $php _dir/docs
  20. 6. Data Base directory: $php _dir/data
  21. 7. Tests Base directory: $php _dir/tests

  22. 1-7, ' all ' or Enter to continue:

Copy Code

You can choose: 1 to set your installation path. Next, you can complete the installation by going to the carriage return. Now you can run it directly: pecl Pear 2 commands to install.

What is: Pear pecl? Pear and pecl are all collections of PHP extensions.  There are two ways to extend PHP: one is to write functions and classes in pure PHP code. Pear is such a project. Pear is the official open source class library for PHP (the abbreviation for PHP Extension and application repository). Pear is the meaning of pears in English. Pear the PHP program development process commonly used in the function of writing into a class library, covering the page surface, database access, file operations, data structure, caching operations, network protocols and many other aspects, users can be very convenient to use. It is a PHP extension and application of a code warehouse, in short, pear is the PHP cpan.  Its homepage is pear.php.net.  The other is to use C or C + + to write external modules loaded into PHP. Pecl (The PHP Extension Community Library) is doing this, PHP's standard extension, which complements the functionality needed in real-world development. All extensions need to be installed, appearing as DLLs under Windows, and compiled separately under Linux, in the form of C in accordance with the official PHP standard, although the source code is open but the average person cannot change the source code at will.  Its homepage is pecl.php.net.  The most straightforward statement: Pear is the upper-level extension of PHP, PECL is the underlying extension of PHP. Both of these methods actually provide ready-made functions or classes for a particular application, essentially the same.

Know the above 2 differences, for our installation is very convenient to understand. Our general so file extension needs to be run: pecl

2. Below, install a: pecl_http extension test

    1. [root@localhost ~]# pecl Search http
    2. Retrieving data ... 0%
    3. Matched packages, channel Pecl.php.net:
    4. =======================================
    5. Package stable/(Latest) Local
    6. Pecl_http 1.7.0 (Stable) Extended HTTP Support
    7. You have new mail in/var/spool/mail/root
    8. [root@localhost ~]# pecl Install Pecl_http
    9. Downloading pecl_http-1.7.0.tgz ...
    10. Starting to download pecl_http-1.7.0.tgz (173,979 bytes)
    11. .... done:173,979 bytes, ....., .....??????????????.
    12. Building source files,
    13. Running:phpize
    14. Configuring for:
    15. PHP Api version:20041225
    16. Zend Module Api no:20060613
    17. Zend Extension Api no:220060519
    18. Whether to enable CURL HTTP requests; Specify Libcurl directory [Yes]:
Copy Code

Run First: The search command is fuzzy and can then be used, pecl install pecl_http. All the way to the return, a moment in: [Root@localhost ~]# ll/usr/lib/php/modules/http.so- rw-r--r--1 root root 1274476 06-26 08:56/usr/lib/php/modules/http.so has its own module. (different system, the location may be different), the previous step after the installation, will tell the module where the address.

3. Compounding php.ini join: extension=http.so is OK.

Then, you can view it through the php-m.

    1. [Root@localhost ~]# Php-m
    2. [PHP Modules]
    3. bz2
    4. Calendar
    5. CType
    6. Curl
    7. Date
    8. dBASE
    9. Dom
    10. Eaccelerator
    11. Exif
    12. Filter
    13. Ftp
    14. Gd
    15. GetText
    16. Gmp
    17. Hash
    18. http
Copy Code

has been successfully installed. PostScript: Other also has source installation, on pecl.php.net find the corresponding source package decompression. Can be through: pecl Install source files.

  • 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.