yum安装的php如何添加模块
2016-10-21 18:16
519 查看
环境说明:
操作系统:CentOS 5.11 x86_64
php版本:php 5.3.3(yum方式安装)
原来php安装过程:
yum -y install httpd php53 php53-bcmath php53-cli php53-common php53-dba php53-devel php53-gd php53-mbstring php53-xml php53-xmlrpc php53-snmp php53-mysql
现在因为项目原因需要安装libevent及pcntl和php-mcrypt,php-mcrypt的安装过程见 http://fengwan.blog.51cto.com/508652/1661548
1.php5.3.3安装libevent
yum -y install libevent-devel
wget
tar xf libevent-0.1.0.tgz
cd libevent-0.1.0
/usr/bin/phpize
./configure --enable-libevent --with-php-config=/usr/bin/php-config
make
make install
#之后就能见到
[root@CentOS5 libevent-0.1.0]# make install
Installing shared extensions: /usr/lib64/php/modules/
echo 'extension=libevent.so'>/etc/php.d/libevent.ini
如果只安装libevent就足够的话,这个时候重新启动httpd服务即可
2.php 5.3.3安装pcntl
pcntl目前存在于php-5.3.3.tar.gz的源码中,需要我们去官网下载源码。
wget http://museum.php.net/php5/php-5.3.3.tar.gz cd php-5.3.3/ext/pcntl
/usr/bin/phpize
./configure --enable-pcntl --with-php-config=/usr/bin/php-config
make
make install
echo 'extension=pcntl.so' >/etc/php.d/pcntl.ini
#重新启动httpd
如果在运行php -m |grep pcntl的时候出现
PHP Warning: Module 'pcntl' already loaded in Unknown on line 0
则可能是出现了重复加载pcntl的情况,则将刚才的/etc/php.d/pcntl.ini删除,重新启动即可。
3.php 5.3.3安装phar并下载phpunit作为测试工具
wget http://museum.php.net/php5/php-5.3.3.tar.gz yum -y install pcre-devel
#phar需要使用pcre模块
cd php-5.3.3/ext/phar
/usr/bin/phpize
./configure --enable-phar --with-php-config=/usr/bin/php-config
make
make install
echo 'extension=phar.so' >/etc/php.d/phar.ini
如果你安装suhosin模块,则需要
修改/etc/php.d/suhosin.ini这行为
suhosin.executor.include.whitelist = phar
如果有设置php.ini的open_basedir则需要注释掉,防止出现各种问题
下载phpunit
wget https://phar.phpunit.de/phpunit.phar chmod +x phpunit.phar
mv phpunit.phar /usr/local/bin/phpunit
phpunit --version
PHPUnit 4.7.7 by Sebastian Bergmann and contributors.
本文出自 “枫林晚” 博客,请务必保留此出处http://fengwan.blog.51cto.com/508652/1675645
操作系统:CentOS 5.11 x86_64
php版本:php 5.3.3(yum方式安装)
原来php安装过程:
yum -y install httpd php53 php53-bcmath php53-cli php53-common php53-dba php53-devel php53-gd php53-mbstring php53-xml php53-xmlrpc php53-snmp php53-mysql
现在因为项目原因需要安装libevent及pcntl和php-mcrypt,php-mcrypt的安装过程见 http://fengwan.blog.51cto.com/508652/1661548
1.php5.3.3安装libevent
yum -y install libevent-devel
wget
tar xf libevent-0.1.0.tgz
cd libevent-0.1.0
/usr/bin/phpize
./configure --enable-libevent --with-php-config=/usr/bin/php-config
make
make install
#之后就能见到
[root@CentOS5 libevent-0.1.0]# make install
Installing shared extensions: /usr/lib64/php/modules/
echo 'extension=libevent.so'>/etc/php.d/libevent.ini
如果只安装libevent就足够的话,这个时候重新启动httpd服务即可
2.php 5.3.3安装pcntl
pcntl目前存在于php-5.3.3.tar.gz的源码中,需要我们去官网下载源码。
wget http://museum.php.net/php5/php-5.3.3.tar.gz cd php-5.3.3/ext/pcntl
/usr/bin/phpize
./configure --enable-pcntl --with-php-config=/usr/bin/php-config
make
make install
echo 'extension=pcntl.so' >/etc/php.d/pcntl.ini
#重新启动httpd
如果在运行php -m |grep pcntl的时候出现
PHP Warning: Module 'pcntl' already loaded in Unknown on line 0
则可能是出现了重复加载pcntl的情况,则将刚才的/etc/php.d/pcntl.ini删除,重新启动即可。
3.php 5.3.3安装phar并下载phpunit作为测试工具
wget http://museum.php.net/php5/php-5.3.3.tar.gz yum -y install pcre-devel
#phar需要使用pcre模块
cd php-5.3.3/ext/phar
/usr/bin/phpize
./configure --enable-phar --with-php-config=/usr/bin/php-config
make
make install
echo 'extension=phar.so' >/etc/php.d/phar.ini
如果你安装suhosin模块,则需要
修改/etc/php.d/suhosin.ini这行为
suhosin.executor.include.whitelist = phar
如果有设置php.ini的open_basedir则需要注释掉,防止出现各种问题
下载phpunit
wget https://phar.phpunit.de/phpunit.phar chmod +x phpunit.phar
mv phpunit.phar /usr/local/bin/phpunit
phpunit --version
PHPUnit 4.7.7 by Sebastian Bergmann and contributors.
本文出自 “枫林晚” 博客,请务必保留此出处http://fengwan.blog.51cto.com/508652/1675645
相关文章推荐
- yum安装的php如何添加模块
- centos 使用yum安装nginx后如何添加模块
- centos6.5源码安装和centos7.2使用yum安装httpd后,如何添加模块;以及怎么设置Cache-Control:max-age=?浏览器缓存时间
- centos6.5源码安装和centos7.2使用yum安装httpd后,如何添加模块;以及怎么设置Cache-Control:max-age=?浏览器缓存时间
- Yum/RPM安装的Nginx如何添加第三方模块(LuaJIT)
- 如何向已经安装好的apache添加一个模块
- 安装成功的nginx如何添加未编译安装模块
- 安装成功的nginx如何添加未编译安装模块
- 如何在CentOS 6上通过YUM安装Nginx和PHP-FPM
- PHP连接SqlServer2008,需要安装mssql,freetds模块(yum安装方式)
- php扩展模块如何安装
- CentOS5 (32bit)下,在 MySQL-Cluster 的 sql node 上安装 PHP5.4.9 时如何添加 mysql 以及 mysqli 扩展
- 如何编译安装一个php模块
- 安装成功的nginx如何添加未编译安装模块
- linux下安装好php后,如何安装其他扩展模块
- 如何在CentOS 6上通过YUM安装Nginx和PHP-FPM
- 生产线上的nginx如何添加未编译安装模块
- 生产线上的nginx如何添加未编译安装模块
- 2.9-PHP扩展模块如何安装
- ImageMagic图像处理软件及扩展模块,如何在php配置中添加扩展的模块