Linux 安装 php-5.4.1
来源:互联网 发布:室内装修设计图软件 编辑:程序博客网 时间:2024/06/08 06:53
之前写过: Linux Apache 安装
Linux 安装 php-5.4.1
1. 下载 php-5.4.1.tar.gz
2. 解压
[root@test31~] tar -zxvf php-5.4.1.tar.gz
3. 进入安装文件目录
[root@test31~] cd php-5.4.1
4. 执行
[root@test31 php-5.4.1]# ./configure --prefix=/usr/local/php5--with-apxs2=/usr/local/web/apache/bin/apxs--with-mysql
注意:绿色标记为你 apache的安装目录
出现问题:
"configure: error: xml2-config not found.Please check your libxml2 installation."
检查是否安装了libxm包
[root@test31 php-5.4.1]# rpm -qa |grep
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.1]#
/usr/bin/xml2-config
如果存在的话重新安装php
[root@test31 php-5.4.1]# ./configure --prefix=/usr/local/php5--with-apxs2=/usr/local/web/apache/bin/apxs--with-mysql
执行如果报错:
需要指定mysql的安装路径
[root@test31 php-5.4.1]# ./configure --prefix=/usr/local/php5--with-apxs2=/usr/local/web/apache/bin/apxs
安装成功的标志是:
出现
+--------------------------------------------------------------------+
|License:
| This software is subject to the PHP License, available inthis
| distribution in the file LICENSE.
| process, you are bound by the terms of this licenseagreement.
| If you do not agree with the terms of this license, you mustabort |
| the installation process at thispoint.
+--------------------------------------------------------------------+
Thank you for using PHP.
[root@test31 php-5.4.1]# make
[root@test31 php-5.4.1]# make install
6. 配置 php.ini
[root@test31 php-5.4.1]# cp php.ini-development /usr/local/lib/php.ini
7. 编辑 httpd.conf 文件以调用 PHP 模块。LoadModule 表达式右边的路径必须指向 系统中的 PHP。以上的make install 命令可能已经完成了这些,但务必要检查。
[root@test31 php-5.4.1]# vi/usr/local/web/apache/conf/httpd.conf
LoadModule php5_module modules/libphp5.so
再加入一行让apache正确处理apache文件
AddType application/x-httpd-php.php
再找到 DirectoryIndex关键字:添加 index.php
开启.httaccess功能
AllowOverrideAll
保存对httpd.conf的修改。
8. 查看是否安装成功
在apache的htdocs目录下建立文件phpinfo.php 输入代码
<?php
phpinfo();
?>
保存,并启动apache。
[root@test31 bin]#./apachectl start
9.打开网址:
出现php相关的信息,说明php-5.4.1 安装成功了!
参考 php 官方文档:
- Linux 安装 php-5.4.1
- linux 5.4 安装php
- Linux 下安装PHP
- Linux下安装PHP
- php linux sphinx 安装
- linux php,perl 安装
- linux安装php
- php linux iconv安装
- Linux下安装PHP
- linux下安装Php
- 【Linux】PHP安装
- linux php安装pear
- Linux安装配置php
- Linux安装配置php
- Linux安装配置php
- Linux中安装php
- linux php 安装imap
- linux下安装php
- GPLI插件下载
- 安装alien,DEB与RPM互换
- [转]用Apache Proxy Bal…
- 安装RPM包快速应急手册
- [转]Apache VirtualHost的用法
- Linux 安装 php-5.4.1
- 单元测试
- Testlink 在Linux 安装
- 面向实时嵌入式系统的图形用户界面支持系统――MiniGUI编译、安装和配置
- mysql 从5.1升级到5.5.33 后 innodb 表出错 及 innodb表修复
- 批量修改文件备忘
- LoadRunner11用IE9 录制脚本时提示:IE浏览器已停止工作 解决
- oracle imp字符集问题的解决
- CentOS6.2更新yum源