国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 临城县| 西林县| 林芝县| 疏附县| 无锡市| 康保县| 清水河县| 青冈县| 连南| 凌海市| 天门市| 西宁市| 寿光市| 岢岚县| 建始县| 聂拉木县| 岑巩县| 盈江县| 双峰县| 大新县| 宣城市| 张北县| 宝山区| 安岳县| 保康县| 务川| 桑植县| 延长县| 双鸭山市| 吉木萨尔县| 怀宁县| 邓州市| 平原县| 平度市| 阜宁县| 玛多县| 新建县| 柳江县| 涞水县| 渑池县| 辰溪县|