博客
关于我
apache2.2.x+php5.5安装部署
阅读量:797 次
发布时间:2023-03-28

本文共 2138 字,大约阅读时间需要 7 分钟。

安装Apache服务器与PHP开发环境(基于CentOS)

一、安装APR和APR-Util

以root用户身份执行以下命令:

tar -zxf apr-1.4.5.tar.gz
cd apr-1.4.5
./configure --prefix=/usr/local/apr
make && make install

安装APR-Util:

tar -zxf apr-util-1.3.12.tar.gz
cd apr-util-1.3.12
./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config
make && make install

二、安装PCRE

unzip -o pcre-8.10.zip
cd pcre-8.10
./configure --prefix=/usr/local/pcre
make && make install

三、安装其他依赖

yum install -y zlib zlib-devel openssl openssl-devel

四、安装Apache服务器

tar -zxf httpd-2.2.31.tar.gz
cd httpd-2.2.31
./configure \
--prefix=/usr/local/apache-2.2.31 \
--with-apxs2=/usr/local/apache-2.2.31/bin/apxs \
--enable-deflate \
--enable-expires \
--enable-headers \
--enable-modules=most \
--enable-so \
--with-ssl \
--enable-ssl \
--enable-cgid \
--enable-cgi \
--with-apr-util=/usr/local/apr-util \
--with-mpm=worker \
--enable-rewrite \
--with-pcre=/usr/local/pcre \
--with-included-apr
make && make install

五、安装PHP开发环境

安装依赖项:

yum install -y zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel libxml2 libcurl libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel xml2 xml2-devel libxslt-devel

安装libiconv:

tar -zxf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/libiconv
make
make install

安装PHP 5.5:

tar -zxf php-5.5.20.tar.gz
cd php-5.5.20
./configure \
--prefix=/usr/local/php5.5.20 \
--enable-mysqlnd \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--enable-bcmath \
--with-gettext \
--with-xmlrpc \
--with-openssl \
--with-zlib \
--with-freetype-dir \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-iconv=/usr/local/libiconv \
--enable-short-tags \
--enable-sockets \
--enable-soap \
--enable-mbstring \
--enable-static \
--enable-gd-native-ttf \
--enable-zip \
--with-curl \
--with-xsl \
--enable-ftp \
--with-gettext \
--enable-opcache \
--with-libxml-dir
make && make install

六、配置Apache支持PHP

在Apache配置文件中添加以下内容:

AddType application/x-httpd-php .php.phtml
AddType application/x-httpd-php-source .phps

七、创建PHP配置文件

ln -s /usr/local/php5.5.20 /usr/local/php
cp php.ini-production /usr/local/php/lib/php.ini

转载地址:http://jshfk.baihongyu.com/

你可能感兴趣的文章
Objective-C实现EM算法(附完整源码)
查看>>
Objective-C实现EM算法(附完整源码)
查看>>
Objective-C实现entropy熵算法(附完整源码)
查看>>
Objective-C实现euclidean distance欧式距离算法(附完整源码)
查看>>
Objective-C实现Euclidean GCD欧几里得最大公约数算法(附完整源码)
查看>>
Objective-C实现euclideanDistance欧氏距离算法(附完整源码)
查看>>
Objective-C实现euler method欧拉法算法(附完整源码)
查看>>
Objective-C实现eulerianPath欧拉路径算法(附完整源码)
查看>>
Objective-C实现eval函数功能(附完整源码)
查看>>
Objective-C实现Exceeding words超词(差距是ascii码的距离) 算法(附完整源码)
查看>>
Objective-C实现extended euclidean algorithm扩展欧几里得算法(附完整源码)
查看>>
Objective-C实现Factorial digit sum阶乘数字和算法(附完整源码)
查看>>
Objective-C实现factorial iterative阶乘迭代算法(附完整源码)
查看>>
Objective-C实现factorial recursive阶乘递归算法(附完整源码)
查看>>
Objective-C实现FigurateNumber垛积数算法(附完整源码)
查看>>
Objective-C实现Gale-Shapley盖尔-沙普利算法(附完整源码)
查看>>
Objective-C实现hamiltonianCycle哈密尔顿图算法(附完整源码)
查看>>
Objective-C实现hamming numbers汉明数算法(附完整源码)
查看>>
Objective-C实现hanning 窗(附完整源码)
查看>>
Objective-C实现hanoiTower汉诺塔算法(附完整源码)
查看>>