栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP

Linux下php5.3.6的安装

PHP 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Linux下php5.3.6的安装

php下载

#cd/usr/local/src/

#wgethttp://cn.php.net/get/php-5.3.6.tar.gz/from/this/mirror


php安装

#tar-zxvfphp-5.3.6.tar.gz

#cdphp-5.3.6

#./configure--prefix=/usr/local/php5.3.6--with-mysql=/usr/local/mysql5.5.9--with-apxs2=/usr/sbin/apxs--enable-mbstring--with-config-file-path=/usr/local/php5.3.6/etc

#make

#makeinstall


ps:

--prefix=/usr/local/php5.3.6指定php安装目录;
--with-mysql=/usr/local/mysql5.5.9指定mysql安装目录;
--with-apxs2=/usr/sbin/apxs指定查找Apache2的地方;
--with-config-file-path=/usr/local/php5.3.6/etc指定php的配置文件目录


php的设定

#cp-prphp.ini-developmentphp.ini

编辑php.ini

#viphp.ini

default_charset="UTF-8"

extension_dir="./ext"

extension=php_mbstring.dll

[mbstring]
mbstring.language=Japanese
mbstring.internal_encoding=UTF-8
mbstring.http_output=UTF-8



Apache的设定

#vi/etc/httpd/conf/httpd.conf

AddTypeapplication/x-httpd-php.php
DirectoryIndexindex.htmlindex.htmindex.html.varindex.php

没有如下的文字,追加

LoadModulephp5_module /usr/lib/httpd/modules/libphp5.so


#/etc/init.d/httpdrestart



遇到的问题与解决方案

问题一:

./configure以下错误发生

Sorry,Icannotrunapxs.Possiblereasonsfollow:

1.Perlisnotinstalled
2.apxswasnotfound.Trytopassthepathusing--with-apxs2=/path/to/apxs
3.Apachewasnotbuiltusing--enable-so(theapxsusagepageisdisplayed)


解决方法:指定正确的apxs路径

1.查找apxs路径

#whereisapxs

apxs:

说明系统没有安装apxs扩展工具


2.安装apxs

#yuminstallhttpd-devel


3.查找apxs路径

#whereisapxs

apxs:/usr/sbin/apxs/usr/share/man/man8/apxs.8.gz

apxs安装成功



问题二:

安装apxs以下错误发生:

Packagecyrus-sasl-plainneedscyrus-sasl-lib=2.1.22-4,thisisnotavailable.

解决方法:

#yum-yinstallcyrus*

之后再次安装apxs



问题三:

再次./configure以下错误发生
configure:error:xml2-confignotfound.Pleasecheckyourlibxml2installation.



解决方法

安装libxml2

#yuminstalllibxml2-devel



问题四:

heckinglibxml2installdir...no
checkingforxml2-configpath.../usr/bin/xml2-config
checkingwhetherlibxmlbuildworks...no

configure:error:buildtestfailed.Pleasechecktheconfig.logfordetails.


解决方法:

#yumerasezlib-devel
#yuminstallzlib-devel

#yuminstalllibxml2-devel


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/227509.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号