linux下安装Php

 

Linux 安装 php-5.4.5

1. 下载 php-5.4.5.tar.gz

2. 解压

[root@test31~] tar -zxvf php-5.4.5.tar.gz

3. 进入安装文件目录

[root@test31~] cd php-5.4.5

4. 执行

[root@test31 php-5.4.5]# ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs --with-mysql

注意:绿色标记为你 apache的安装目录

出现问题:

"configure: error: xml2-config not found. Please check your libxml2 installation."

检查是否安装了libxm包

[root@test31 php-5.4.5]# rpm -qa |grep  libxml2
libxml2-2.6.26-2.1.12
libxml2-python-2.6.26-2.1.12

重新安装libxml2和libxml2-devel包

yum install libxml2

yum install libxml2-devel -y (装这个)

安装完之后查找xml2-config文件是否存在

[root@test31 php-5.4.5]#  find / -name "xml2-config"
/usr/bin/xml2-config

如果存在的话重新安装php

[root@test31 php-5.4.5]# ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs --with-mysql

执行如果报错:  Cannot find MySQL header files under yes

需要指定mysql的安装路径

[root@test31 php-5.4.5]# ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql

安装成功的标志是:

出现

+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值