php53安装过程中遇到的问题.docx
《php53安装过程中遇到的问题.docx》由会员分享,可在线阅读,更多相关《php53安装过程中遇到的问题.docx(6页珍藏版)》请在冰豆网上搜索。
php53安装过程中遇到的问题
php5.3安装过程中遇到的问题
1:
php5.3.24版本的和php5.2.*版本的编译参数不同
我在php5.2.*中使用的编译参数如下:
./configure--prefix=/usr/local/php
--with-config-file-path=/usr/local/php/etc
--with-mysql=/usr/local/mysql
--with-mysqli=/usr/local/mysql/bin/mysql_config
--with-iconv-dir--with-freetype-dir--with-jpeg-dir
--with-png-dir--with-zlib--with-libxml-dir=/usr
--enable-xml--disable-rpath--enable-discard-path
--enable-safe-mode--enable-bcmath--enable-shmop
--enable-sysvsem--enable-inline-optimization--with-curl
--with-curlwrappers--enable-mbregex--enable-fastcgi
--enable-force-cgi-redirect--enable-mbstring
--with-mcrypt--with-gd--enable-gd-native-ttf
--with-openssl--with-mhash--enable-pcntl
--enable-sockets--with-ldap--with-ldap-sasl
--with-xmlrpc--enable-zip--enable-soap
--with-apxs2=/usr/local/apache/bin/apxs
当我同样将该参数放到php5.3.24下编译有如下提示:
在configurephp5.3.24时发现
Notice:
Followingunknownconfigureoptionswereused:
--enable-discard-path
--enable-fastcgi
--enable-force-cgi-redirectCheck'./configure--help'foravailableoptions
confiugre里面没有这几个参数了!
2:
maketest时出错:
[root@centos5xenphp-5.3.24]#maketestBuildcomplete.
Don'tforgettorun'maketest'.Warning:
putenv():
SafeModewarning:
Cannotsetenvironmentvariable'SSH_CLIENT'-it'snotintheallowedlistin
/home/liuxiaojie/php-5.3.24/run-tests.phponline98Warning:
putenv():
SafeModewarning:
Cannotsetenvironmentvariable'SSH_AUTH_SOCK'-it'snotintheallowedlistin/home/liuxiaojie/php-5.3.24/run-tests.phponline99
Warning:
putenv():
SafeModewarning:
Cannotsetenvironmentvariable'SSH_TTY'-it'snotintheallowedlistin/home/liuxiaojie/php-5.3.24/run-tests.phponline100
Warning:
putenv():
SafeModewarning:
Cannotsetenvironmentvariable'SSH_CONNECTION'-it'snotintheallowedlistin/home/liuxiaojie/php-5.3.24/run-tests.phponline101
Warning:
set_time_limit():
Cannotsettimelimitinsafemodein/home/liuxiaojie/php-5.3.24/run-tests.phponline104
|Youarerunningthetest-suitewith'safe_mode'ENABLED!
|
|
|
|Chancesarehighthatnotestwillworkatall,|
|dependingonhowyouconfigured'safe_mode'!
|
ERROR:
invalidPHPexecutablespecifiedbyTEST_PHP_EXECUTABLE=
/home/liuxiaojie/php-5.3.24/sapi/cli/php
解决方法:
这个错误可以忽略,直接makeinstall即可!
3:
安装memcache时遇到的问题
安装php扩展memcache时遇到问题:
checkingtargetsystemtype...i686-pc-linux-gnu
configure:
error:
Cannotfindphp-config.Pleaseuse
--with-php-config=PATH解决方法:
./configure
--with-php-config=/usr/local/php/bin/phpconfig4:
configure:
error:
mcrypt.hnotfound.Pleasereinstalllibmcrypt.
解决方法:
yum-yinstalllibmcrypt-devel5:
onfigure:
error:
Pleasereinstalllibmhash-Icannotfindmhash.h
解决方法:
yum-yinstallmhash-devel6:
php:
errorwhileloadingsharedlibraries:
libmysqlclient.so.18:
cannotopensharedobjectfile
解决方法:
echo'/usr/local/mysql/lib'>>/etc/ld.so.confs
ldconfig-v即可7:
Cannotloadmodules/libphp5.sointoserver:
/usr/local/apache2/modules/libphp5.so:
undefinedsymbol:
unixd_config
原因:
php5.2的版本和httpd-2.4不匹配!
老外的两个回答如下:
Thereasonyou'rehavingthisissueisbecauseitseemsPHP5.2isn'tcompatiblewithApache2.4becauseit'susinga(now)deprecatedApacheAPI.ThedevelopersatPHP
arenolongersupporting5.2,andthusitisunlikelythattherewillbeanyupdatestorectifythisinthefuture.YouroptionsaretoeitherchangePHPversions,orremainatApache2.2.
Hi,
Iguessthatthethephpversionyou'retryingtoinstallisnotawareofthechangesmadeinapache-2.3.x
Whydon'tyoutrytoinstallthelatestphp-5.3.9insteadoftheold5.2.17thatisnolongersupported.
8:
configure:
error:
Cannotfindldaplibrariesin/usr/lib.
其实我相关软件已经安装了:
[root@localhost~]#rpm-qa|grepldap
openldap-2.4.23-32.el6_4.x86_64
openldap-devel-2.4.23-32.el6_4.x86_64[root@localhost~]#解决方法:
cp-frp/usr/lib64/libldap*/usr/lib/9:
/bin/sh:
/home/liuxiaojie/install/php-5.3.24-src/build/shtool:
Permissiondenied
/bin/sh:
-d:
commandnotfound
make:
***[ext/phar/phar.php]Error127解决方法:
[root@localhostbuild]#pwd
/home/liuxiaojie/install/php-5.3.24-src/build
[root@localhostbuild]#chmodaxshtool
[root@localhostbuild]#10:
chmod:
cannotaccess
'ext/phar/phar.phar':
Nosuchfileordirectory
[root@localhostphp-5.3.24-src]#make
Generatingphar.pharchmod:
cannotaccess'ext/phar/phar.phar':
Nosuchfileor
directorymake:
[ext/phar/phar.phar]Error1(ignored)Buildcomplete.
Don'tforgettorun'maketest'.解决方法:
此处可以忽略,但可以解决:
解决方法:
如下
/home/liuxiaojie/install/php-5.3.24-src/ext/phar
cpphar.phpphar.phar11:
configure:
error:
mcrypt.hnot
found.Pleasereinstalllibmcrypt.##安装mcrypt扩展时报错解决方法:
tarzxvflibmcrypt-2.5.8.tar.gz
cdlibmcrypt-2.5.8
./configure
make
makeinstall12:
configure:
error:
notfound.Pleasereinstalltheexpatdistribution.
其实已经安装了expat和expat-devel
解决方法:
ln-sv/lib64/libexpat.*/lib/
ln-sv/usr/lib64/libexpat.*/usr/lib/13:
configurephp时报错如下:
-bash:
./configure:
Permissiondenied:
解决方法:
chmodaxconfigure14:
configure:
error:
Unabletolocategmp.h:
解决方法:
yum-yinstallgmp-devel15:
Cannotfindconfig.m4.
[root@localhostinstall]#/usr/local/webserver/php/bin/phpize
Cannotfindconfig.m4.
Makesurethatyourun
'/usr/local/webserver/php/bin/phpize'inthetoplevelsourcedirectoryofthemodule
故障原因:
目录的位置错了,应该在APC-1.*所在的目录16:
##转载的,试过了,确实可以解决问题/usr/bin/ld:
ext/ldap/.libs/ldap.o:
undefinedreferencetosymbol'ber_pvt_opt_on@@OPENLDAP_2.4_2'/usr/bin/ld:
note:
'ber_pvt_opt_on@@OPENLDAP_2.4_2'isdefinedinDSO/usr/lib/x86_64-linux-gnu/liblber-2.4.so.2
sotryaddingittothelinkercommandline
/usr/lib/x86_64-linux-gnu/liblber-2.4.so.2:
couldnotread
symbols:
Invalidoperation
搜索了好久在老外的一篇文章中终于找到解决办法
-Runyourconfigurecommand
-editMakefile
-Findthelinethatstartswith'EXTRA_LIBS='-Addthefollowingtotheendoftheline'-llber'