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