Linux sharing method compiled PHP extension

Source: Internet
Author: User

Whether it is to install PHP or later to add extensions to PHP, in fact, directly download the PHP source package, the inside of the install file read it will be.

1, install PHP

installation, not to consider so much, after a variety of dependent packages installed, directly follow the method installed in the installation of a simple PHP, and then use a shared way to add additional PHP extension package to ok!

2,extension Installation

The installation of PHP extensions, the installation of official documentation is available in two ways: pecl Way and Phpize Way

Then there are two ways to join the extension: Shared and static (probably all in a shared way ...). )

I'm using phpize to add it in a shared way

Under the PHPSRC directory, switch to: Ext/extname directory, execute the following command:

The command is simple:

$ CD Extname
$ phpize or phpize--clean (this is the first time the installation failed, one step before the second installation to clean up the action)
$./configure
$ make
# make Install

Some errors may be prompted at this time, and errors are generally caused by the lack of some libraries, and the following are some common errors:

Error: Configure:error:Please Reinstall the Libcurl distribution-easy.h should be in <Curl-dir&G t; /include/curl/

Solution: Yum-y Install Curl-devel

Error: If Configure fails try --with-jpeg-dir= Configure: Error:libpng. (A|SO) not found.

Solution: Yum-y Install Libpng-devel

Error: Configure:error:mcrypt.h not found. Please reinstall Libmcrypt.

Solution: Yum Install Libmcrypt Libmcrypt-devel

Error: Configure:error:xml2-config not found. Please check your LIBXML2 installation.

Solution: Yum-y Install LIBXML2 Libxml2-devel

Error: Configure:error:libevent >= 1.4.11 could not be found

Solution: Yum-y Install libevent Libevent-devel


Linux sharing method compiled PHP extension

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.