linux 下安装 php 扩展 典型安装 mysql curl mb_string
curl扩展:[*] 下载 cURL http://pan.baidu.com/s/1hqrHWkG (curl-7.39.0.tar.gz) 3.98MB
[*] tar zxvf curl-7.39.0.tar.gz
[*] ./configure --prefix=/usr/local/curl
[*]http://static.blog.csdn.net/images/save_snippets_01.png
[*] view plain copy
[*] make && make install
[*] 安装 curl 成功后,进入 PHP 的源码包(非php安装地址)
[*]
[*] view plain copy https://code.csdn.net/assets/CODE_ico.pnghttps://code.csdn.net/assets/ico_fork.svg
[*] cd /var/soft/php-5.3.19/ext/curl
[*] /usr/local/php/bin/phpize 注:/usr/local/php 为我的php安装目录
[*] ./configure --with-php-config=/usr/local/php/bin/php-config --with-curl=/usr/local/curl/
[*] make && make install
[*] 成功后出现 curl.so 的所在目录
[*] 打开 php.ini 添加 extension=xxx/curl.so
[*] 重启 apache 即可。
------------------------------------------------------------------------------------------------------------------------------
最近购置了一台阿里云ec服务器centos64系统,在安装phpmyadmin选择源码安装时报错Fatal error: Call to undefined function mb_detect_encoding()
出错原因:
由于当时选择多语言种类的安装,所以用到了php的mbtring扩展,这个扩展是默认不开启的。
解决方案:
# cd/www/php-5.5.14/ext/mbstring/ //打开php安装源文件的找到ext下的mbstring文件夹
# /usr/local/php/bin/phpize //执行php安装后目录中的bin/phpize文件
# ./configure --with-php-config= /usr/local/php/bin/php-config //执行configure命令
# make
# make install
修改php.ini中的扩展路径
extension_dir=" /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/"
如果php.int中有extension=mbstring.so就把前面的注释符号去掉,如果没有就加上这句话。
ps:在安装这个扩展中走了很多弯路,主要是extension_dir路径的指定,好多文章说扩展路径是extension_dir="xxx/xxx/xxx/ext",所以浪费很多时间,希望看到我文章的同学少走些弯路。一定要搞清楚自己的正确的扩展路径哈~~
补充,生成的XXXX.so扩展,在php/ext/curl/modules/curl.so
页:
[1]