linux下安装插件 php 安装在/usrlocal/php5/bin/phpize下
[root@ttl289 ~]# tar -zxf php-5.2.4.tar.gz
[root@ttl289 ~]# cd php-5.2.4/ext/mcrypt/
[root@ttl289 mcrypt]# /usr/local/php5/bin/phpize #创建configure文件
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script. #这边出错,显示找不到autoconf文件
[root@ttl289 mcrypt]# yum install autoconf #运行安装autoconf
[root@ttl289 mcrypt]# /usr/local/php5/bin/phpize #再次执行 ,正常。
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
[root@ttl289 mcrypt]# ./configure --with-mcrypt --with-php-config=/usr/local/php5/bin/php-config
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details. #安装出错,没有gcc编译工具。
[root@ttl289 mcrypt]# rpm -qa |grep gcc
libgcc-4.1.2-14.el5
[root@ttl289 gcc]# yum install gcc
[root@ttl289 mcrypt]# ./configure --with-mcrypt --with-php-config=/usr/local/php5/bin/php-config #编译 需要注意的是php-config文件的位置
configure: WARNING: You will need re2c 0.12.0 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for mcrypt support... yes, shared
configure: error: mcrypt.h not found. Please reinstall libmcrypt. #有报错,需要安装libmcrypt-devle
[root@ttl289 mcrypt]# yum install libmcrypt
[root@ttl289 mcrypt]# yum install libmcrypt-devel
[root@ttl289 mcrypt]# ./configure --with-mcrypt --with-php-config=/usr/local/php5/bin/php-config #再次编译
[root@ttl289 mcrypt]# make
[root@ttl289 mcrypt]# make install
Installing shared extensions: /usr/local/php5/lib/php/ #安装成功
注意:需要在php.ini 文件里面添加 extension=mcrypt.so
[root@ttl289 mcrypt]/usr/local/php5/bin/php -m |grep mcrypt
[PHP Modules]
mcrypt
现在自此完成安装
附加::
当执行make 时大致出现一下报错:
在安装pdo_mysql时,当执行make test 报如下错误时:安装php是 碰到一个错误configure: error: Try adding --with-zlib-dir=<DIR>.然后提示查看configure.log
错误原因显示如下
/usr/bin/ld: cannot find -lmysqlclient
则说明没有安装mysql-devel或MySQL-devel-community,安装即可。。。。。。。。。。
当make完之后未报错,进行make test时,如下如下错误:
Running selected tests.
SKIP PDO MySQL Bug #33689 [tests/bug_33689.phpt] reason: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)
<br />/6 [tests/common.phpt]
<b>Warning</b>: opendir(ext/pdo/tests) [<a href='function.opendir'>function.opendir</a>]: failed to open dir: No such file or directory in <b>/var/backup/zzz/php-5.1.6/ext/pdo_mysql/run-tests.php</b> on line <b>575</b><br />
ERROR: cannot open directory: ext/pdo/tests
make: [test] Error 1 (ignored)
(/var/backup/zzz/php-5.1.6/ext/pdo_mysql/ 是你当前安装的目录)
不予理睬,直接执行make install
2009-04-21
本文出自 “五片棱角” 博客,请务必保留此出处http://hi289.blog.51cto.com/4513812/1754995