centos 安装apache 和 php5.6
centos 安装 php5.6,安装前需要先安装数据库和apache
安装 apache2.4
安装基础依赖:
# yum install gcc gcc-c++ glibc glibc-devel gd gd-devel zlib zlib-devel libtool-ltdl-devel flex autoconf automake
apache 需要依赖apr 和 apr-util、apr-iconv、pcre
所以还需要先安装 apr和apr-util、apr-iconv
# wget http://apache.fayea.com//apr/apr-1.5.2.tar.gz
# wget http://apache.fayea.com//apr/apr-util-1.5.4.tar.gz
# wget http://apache.fayea.com//apr/apr-iconv-1.2.1.tar.gz
# wget https://sourceforge.net/projects/pcre/files/pcre/7.9/pcre-7.9.zip
#
# tar xzvf apr-1.5.2.tar.gz
# tar xzvf apr-util-1.5.4.tar.gz
# tar xzvf apr-iconv-1.2.1.tar.gz
# cd apr-1.5.2
# ./configure --prefix=/usr/local/apr
# make
# make install
# cd ..
# cd apr-util-1.5.4
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make
# make insatll
# cd ..
# cd apr-iconv-1.2.1
# ./configure --prefix=/usr/local/apr-iconv --with-apr=/usr/local/apr
# make
# make insatll
#
# 安装pcre
# unzip pcre-7.9.zip
# cd pcre-7.9
# ./configure --prefix=/usr/local/pcre
# make && make install
apache历史版本下载地址:
# wget http://archive.apache.org/dist/httpd/httpd-2.4.9.tar.gz
# tar xzvf httpd-2.4.9.tar.gz
# cd httpd-2.4.9
# ./configure --prefix=/usr/local/apache --enable-track-vars --enable-cgi --enable-proxy-fcgi --with-config-file-path=/usr/local/apache/conf --with-apr=/usr/local/apr -with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
# make
# make install
说明:enable-cgi 支持CGI;enable-track-vars 为启动cookie的get/post等追踪功能
将apache安装为系统服务
# cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
# service httpd start
安装php5.6
下载:
# wget http://cn2.php.net/distributions/php-5.6.25.tar.bz2
解压
# bunzip2 php-5.6.25.tar.bz2
# tar xvf php-5.6.25.tar
#
# cd php-5.6.25
# ./configure --prefix=/usr/local/php5.6 \
--with-libxml-dir=/usr/include/libxml2 --with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/apache/conf \
--with-mysqli=/usr/local/mysql/bin/mysql_config --with-gd --enable-gd-native-ttf \
--with-zlib --with-mcrypt --with-pdo-mysql=/usr/local/mysql --enable-shmop \
--enable-soap --enable-sockets --enable-wddx --enable-zip --with-xmlrpc \
--enable-fpm --enable-mbstring --with-zlib-dir --with-bz2 --with-curl --enable-exif \
--enable-ftp --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib \
--with-freetype-dir=/usr/lib/ --with-pgsql=/usr/local/pgsql --with-pdo-pgsql=/usr/local/pgsql
注意引用的相关数据库和工具的路径,不然编译会报错误,编译引入了apache,是因为要支持使用apache服务器,需要先安装apache
其中 --with-config-file-path表示php.ini的配置文件路径, --with-apxs2 标识编译apache2的链接为共享Handler模式。
# make
# make install
建议修改一下php的时间格式,默认是美国时间
修改php.ini文件:
date.timezone = Asia/Shanghai
php5.6安装完毕
修改httpd.conf配置文件
1. 添加php支持。
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
2. 添加默认索引页面index.php,再找到“DirectoryIndex”,在index.html后面加上“ index.php”
DirectoryIndex index.html index.php
3. 不显示目录结构,找到“Options Indexes FollowSymLinks”,修改为
Options FollowSymLinks
4. 开启Apache支持伪静态,找到“AllowOverride None”,修改为
AllowOverride All
重启apache服务即可。
创建一个php文件测试看能否显示php信息
<?
phpinfo();
centos 安装apache 和 php5.6的更多相关文章
- centos 7.2 安装apache,mysql,php5.6
安装Apache.PHP.Mysql.连接Mysql数据库的包: yum -y install httpd yum -y install php yum -y install php-fpm yum ...
- centos安装apache
查询是否已安装apache: rpm -qa httpd 安装apache: yum install httpd -y 查询: chkconfig httpd on 启动: service http ...
- CentOS 安装apache 及所需的 apr,apr-util,pcre
安装apache前确定已安装 apr,apr-util,pcre 一.安装apr [root@xt test]# tar -zxf apr-1.4.5.tar.gz [root@xt test]# c ...
- CentOS 安装apache
yum 安装apache yum –y install httpd 设置开机启动 chkconfig --levels 235 httpd on 启动 /etc/init.d/httpd start ...
- 阿里云 centos 安装apache和php
mysql使用阿里云的rds httpd服务 1. 安装apr和apr-util 2. 安装 httpd apache.org,apr.apache.org 安装命令: ./configure --p ...
- [部署]CentOS安装apache
环境 虚拟机:VMWare10.0.1 build-1379776 操作系统:CentOS7 64位 步骤 1.使用yum安装 yum install httpd httpd-devel 2.启动 a ...
- centos 安装apache activemq
安装说明 安装环境:CentOS-6.3 安装方式:源码安装 软件:apache-tomcat-7.0.29.tar.gz下载地址http://activemq.apache.org/downloa ...
- Centos 安装Apache软件
检查rpm -qa httpd [root@luozhonghua icons]# rpm -qa |grep httpd httpd-2.2.15-30.el6.centos ...
- Centos 安装旧版php5.2
# yum remove php-* # cd /root/ && mkdir new_php && cd new_php # wget -r http://yum.m ...
随机推荐
- hdu 1455 Sticks(dfs+剪枝)
题目大意: George有许多长度相同的木棍,随机的将这些木棍砍成小木条,每个小木条的长度都是整数单位(长度区间[1, 50]).现在George又想把这些小木棒拼接成原始的状态,但是他忘记了原来他有 ...
- 转:union和union all的区别
Union因为要进行重复值扫描,所以效率低.如果合并没有刻意要删除重复行,那么就使用Union All 两个要联合的SQL语句 字段个数必须一样,而且字段类型要“相容”(一致): 如果我们需要将两个 ...
- 根据UIColor对象,获取对应的RGBA值
- (NSArray *)getRGBWithColor:(UIColor *)color { CGFloat red = 0.0; CGFloat green = 0.0; CGFloat blue ...
- css之absolute绝对定位(技巧篇)
无依赖的绝对定位 margin,text-align与绝对定位的巧妙用法 例子1:实现左右上角的图标覆盖,如图,
- css3中单位px,em,rem,vh,vw,vmin,vmax的区别及浏览器支持情况
原文地址: http://blog.csdn.net/jyy_12/article/details/42557241 px:绝对单位,页面按精确像素展示 em:相对单位,基准点为父节点字体的大小,如果 ...
- Java程序调用javascript等脚本的实现方法
public static void main(String[] args) throws FileNotFoundException, ScriptException, NoSuchMethodEx ...
- HTTP Client工具类
HTTP Client工具类: import org.apache.http.Header;import org.apache.http.HttpEntity;import org.apache.ht ...
- Android.mk 基本应用
如果是在android源码里面编译我们自己的应用,就需要这个android.mk文件,这个文件就告诉android系统应用如何来编译这个应用以及这个应用它所依赖哪些文件等等信息.我对android.m ...
- aspx页面调用发送邮件验证码(结合前两篇)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs ...
- Error:SSL peer shut down incorrectly
从别的地方拷贝过来的项目有时会报这个错误,解决方法 File -> Project Structure -> project 对比本地项目和拷贝项目并修改至与本地项目一致