国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 服務(wù)器 > Linux服務(wù)器 > 正文

Linux下獨(dú)立添加PHP擴(kuò)展模塊mbstring的方法

2024-09-05 23:02:13
字體:
供稿:網(wǎng)友
環(huán)境php5.2.13, 不支持mbstring擴(kuò)展
假如php的源碼包在/usr/local/src/php-5.2.13
php安裝目錄是/usr/local/php

復(fù)制代碼 代碼如下:


# cd /usr/local/src/php-5.2.13/ext/mbstring/
# rpm -qa|egrep "autoconf|gcc" 這個(gè)是檢測(cè)這些組件是否安裝,沒有安裝請(qǐng)執(zhí)行下面這句,否則會(huì)報(bào)錯(cuò)
# yum -y install autoconf gcc gcc-c++
# phpize
# ./configure --with-php-config=/usr/local/bin/php-config
# make
# make install


執(zhí)行完畢后在php.ini里增加extension=mbstring.so

重啟web服務(wù)器, 看一下phpinfo, 應(yīng)該支持mbstring了!



1.安裝crul

復(fù)制代碼 代碼如下:


wget
tar -zxvf curl-7.19.6.tar.gz
cd curl-7.19.6
./configure --prefix=/usr/local/curl
make
make install



2.編譯生成擴(kuò)展
進(jìn)入php源程序目錄中的ext目錄中,這里存放著各個(gè)擴(kuò)展模塊的源代碼,選擇你需要的模塊,比如curl模塊:
cd curl
執(zhí)行phpize生成編譯文件,phpize在PHP安裝目錄的bin目錄下
/usr/local/php5/bin/phpize
運(yùn)行時(shí),可能會(huì)報(bào)錯(cuò):Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script.,需要安裝autoconf:
yum install autoconf(RedHat或者CentOS)、apt-get install autoconf(Ubuntu Linux)


生成配置文件,并編譯生成模塊:
/usr/local/php5/bin/phpize
./configure --with-curl=/usr/local/curl --with-php-config=/usr/local/php5/bin/php-config
make
make install
生成的文件在(如:/usr/local/php5/extensions/no-debug-non-zts-20090626/)
這樣,curl.so就被復(fù)制到PHP對(duì)應(yīng)目錄(如:/usr/local/php5/extensions/)


3.修改配置
在php.ini里,設(shè)置擴(kuò)展目錄:
extension_dir = "/usr/local/php5/extensions/"
并添加擴(kuò)展模塊引用:
extension = curl.so


4.檢查并重啟Apache
/usr/local/php5/bin/php -v
執(zhí)行這個(gè)命令時(shí),php會(huì)去檢查配置文件是否正確,如果有配置錯(cuò)誤,這里會(huì)報(bào)錯(cuò),可以根據(jù)錯(cuò)誤信息去排查
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 甘孜县| 营山县| 中方县| 克什克腾旗| 保德县| 东港市| 德安县| 伊吾县| 涿鹿县| 南宫市| 吉木乃县| 读书| 安丘市| 城市| 交城县| 新河县| 天津市| 三明市| 无棣县| 蓬安县| 太白县| 大厂| 聂荣县| 揭东县| 永州市| 休宁县| 台安县| 房山区| 临武县| 桦南县| 工布江达县| 宣武区| 永仁县| 崇明县| 彭阳县| 盖州市| 紫阳县| 洛川县| 定西市| 昭苏县| 专栏|