How to install the PHP extension module

Source: Internet
Author: User

How to install the PHP extension module

PHP and Apache are similar, the core file for/usr/local/php/bin/php, for the Apache thing/usr/local/apache2/modules/libphp5.so module. These two files are the core, we compile PHP in advance to let him support some features, such as support for MySQL, this function is actually a PHP module, but this module is directly and PHP or libphp5.so files compiled together. When we compiled the PHP, we found that we also need to let PHP support additional modules, this time can recompile PHP, plus configuration parameters, or directly compile a separate module file. Then get PHP to call it. So let's take the example of compiling memcache:

(1) Download Memcache source Package

# wget http://www.apelearn.com/bbs/data/attachment/forum/memcache-2.2.3.tgz

(2) Installation

#tar jxf memcache-2.2.3.tgz

#cd memcache-2.2.3

#/usr/local/php/bin/phpize

Description: This step is based on the configgurs file generated by the PHP phpize tool. You may encounter errors in this step, such as "Cannot find CONFIG.M4," because the system has not yet installed the M4 tool and uses Yum to install Yum install-y M4. There are also errors "cannot find autoconf," the solution is that Yum install-y autoconf.

#./configure--with-php-config=/usr/local/php/bin/php-config

#make

#make Install

#cp modules/memcache.so/usr/local/php/ext/

Description: when make is built, a memcache.so module file is generated, which is what we want to use. Then copy the memcache.so to PHP Extension_dir. The way to view PHP Extension_dir is to edit the php.ini file and modify it as follows:

Extension_dir = "/usr/local/php/ext"

Then continue to add the php.ini in the

Extension =memcache.so

After saving, you can use the "/usr/local/php/bin/php-m" command to detect and view specific modules if there are memcache instructions to configure success.


This article from "12350027" blog, declined reprint!

How to install the PHP extension module

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.