88.PHP Expansion Module Installation

Source: Internet
Author: User
Tags zts

PHP Expansion Module Installation
编译httpd时,有涉及动态和静态模块,PHP也一样有静态与动态之分,之前所涉及到的PHP安装都全部为静态,并没有任何动态的模块,所谓动态,就是一个独立存在的.so文件,在httpd中PHP就是以动态模块的形式被加载的。PHP一旦编译完成后,要想再增加一个功能的话,要么重新编译PHP,要么直接编译一个扩展模块(生成一个.so文件),然后在php.ini中配置一下,就可以被加载使用了。1、查看PHP加载的模块[[email protected] ~]# /usr/local/php/bin/php -m[PHP Modules]bz2CorectypedatedomeregexiffileinfofiltergdhashiconvjsonlibxmlmbstringmcryptmysqlmysqliopensslpcrePDOpdo_mysqlpdo_sqlitePharposixReflectionsessionSimpleXMLsoapsocketsSPLsqlite3standardtokenizerxmlxmlreaderxmlwriterzlib[Zend Modules]
2. Install a PHP extension Module (Redis module)
[[email protected] ~]# cd/usr/local/src/[[email protected] src]# wget https://codeload.github.com/ Phpredis/phpredis/zip/develop[[email protected] src]# MV Develop phpredis-develop.zip[[email protected] src]# unzip Phpredis-develop.zip [[email protected] src]# CD phpredis-develop/[[email protected] phpredis-develop]#/usr/local/php/bin/phpize//purpose is to generate configure file configuring for:php Api Version:20131106zend Module API No:20131226zend Extension API No:220131226cannot find autoconf. Please check your autoconf installation and THE$PHP_AUTOCONF environment variable. Then, the rerun this script.//error cannot find autoconf, need to install some autoconf[[email protected] phpredis-develop]# yum Install- Y autoconf[[email protected] phpredis-develop]#/usr/local/php/bin/phpize configuring For:PHP Api version:20 131106Zend Module API No:20131226zend Extension API no:220131226[[email protected] phpredis-develop]#./conf Igure--with-php-cOnfig=/usr/local/php/bin/php-config[[email protected] phpredis-develop]# make[[email protected] phpredis-develop]# make installinstalling shared extensions:/usr/local/php/lib/php/extensions/ No-debug-zts-20131226///make install will put the compiled Redis into this directory, which is the directory for the extension module [[email protected] phpredis-develop]#/ Usr/local/php/bin/php-i | Grep-i Extension_dirextension_dir =/usr/local/php/lib/php/extensions/no-debug-zts-20131226 =/usr/local/ Php/lib/php/extensions/no-debug-zts-20131226sqlite3.extension_dir = no value + No value//View the expansion module catalog, You can also modify the directory in php.ini [[email protected] phpredis-develop]# ls/usr/local/php/lib/php/extensions/ No-debug-zts-20131226/opcache.so redis.so
3. Modify the PHP configuration file to make the extension effective

[```
[Email protected] phpredis-develop]# Vim/usr/local/php/etc/php.ini//Add the following

Extension = redis.so

[Email protected] phpredis-develop]#/usr/local/php/bin/php-m | grep Redis//See if Redis is loaded
Redis

88.PHP Expansion Module Installation

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.