本篇文章主要介绍如何在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. 进入安装文件目录
立即学习“PHP免费学习笔记(深入)”;
[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 (装这个)
SmartB2B 是一款基于PHP、MySQL、Smarty的B2B行业电子商务网站管理系统,系统提供了供求模型、企业模型、产品模型、人才招聘模型、资讯模型等模块,适用于想在行业里取得领先地位的企业快速假设B2B网站,可以运行于Linux与Windows等多重服务器环境,安装方便,使用灵活。 系统使用当前流行的PHP语言开发,以MySQL为数据库,采用B/S架构,MVC模式开发。融入了模型化、模板
安装完之后查找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.
相关推荐:









