php增加模組的方法

2021-09-20 09:17:02 字數 2376 閱讀 4429

安裝gettext 模組

[root@localhost ~]# cd /usr/src/php-5.3.27/ext/gettext/

[root@localhost gettext]# phpize 

configuring for:

php api version:         20090626

zend module api no:      20090626

zend extension api no:   220090626

[root@localhost gettext]# ./configure --with-php-config=/usr/local/bin/php-config

[root@localhost gettext]# make

[root@localhost gettext]# make install

installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20090626/

[root@localhost gettext]# ls modules/

gettext.so

修改php的配置檔案php.ini,新增擴充套件模組

[root@localhost local]# vi /usr/local/lib/php.ini

extension=gettext.so          ###增加 這一行

bcmath模組安裝

[root@localhost bcmath]# phpize 

configuring for:

php api version:         20090626

zend module api no:      20090626

zend extension api no:   220090626

[root@localhost bcmath]# ./configure --with-php-config=/usr/local/bin/php-config

[root@localhost bcmath]# make 

[root@localhost bcmath]# make install

installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20090626/

[root@localhost bcmath]# ls modules/

bcmath.so

修改php的配置檔案php.ini,新增擴充套件模組

[root@localhost local]# vi /usr/local/lib/php.ini

extension= bcmath.so         ###增加 這一行

sockets模組安裝

[root@localhost ext]# cd sockets/

[root@localhost sockets]# phpize

configuring for:

php api version:         20090626

zend module api no:      20090626

zend extension api no:   220090626

[root@localhost sockets]# ./configure --with-php-config=/usr/local/bin/php-config 

[root@localhost sockets]# make

[root@localhost sockets]# make install

installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20090626/

installing header files:          /usr/local/include/php/

[root@localhost sockets]# ls modules/

sockets.so

修改php的配置檔案php.ini,新增擴充套件模組

[root@localhost local]# vi /usr/local/lib/php.ini

extension=sockets.so         ###增加 這一行

擴充套件安裝完成後重啟apache

[root@localhost sockets]# /etc/init.d/apache restart

檢視php模組發現目前已經出現了三個模組

PHP動態模組增加

以安裝openssl模組為例 注 配置php的openssl模組需要優先配置系統openssl功能 解壓php原始檔,進入原始檔下 ext openssl 目錄 usr local php bin phpize 注 該步驟會生成configure檔案,執行時可能提示缺少檔案config.m4,將當前...

openwrt增加核心模組的方法

下面就是增加核心模組的方法了 進入package目錄,建立模組目錄 cd backfire package mkdir example 進入example目錄,建立makefile檔案和 路徑 cd example touch makefile mkdir src makefile具體內容如下 th...

rpm安裝的php 通過編譯增加模組

第一步 先確認安裝了安裝包的基礎包,通常使用系統更新安裝即可 yum list libmcrypt yum install libmcrypt 第二步 進入php原始碼解壓後的目錄中,如我這裡是php 5.2.13,cd root downloads php 5.2.13 ext mcrypt 第三...