标签:php
继上一篇文章Mysql,这一章讲如何部署php服务。yum install \
libjpeg-devel \
libpng-devel \
freetype-devel \
zlib-devel \
gettext-devel \
libXpm-devel \
libxml2-devel \
fontconfig-devel \
openssl-devel \
bzip2-devel
tar xzvf gd-2.0.35.tar.gz -C /opt
#进入gd目录下
cd /opt/gd/2.0.35
配置
./configure --prefix=/usr/local/gd
编译并安装
make && make install
tar xjvf /opt/lamp/php-5.4.5.tar.bz2 -C /opt
先进入到php目录下
cd /opt/php-5.4.5/
然后配置
./configure \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-gd \
--with-mysql=/usr/local/mysql \
--with-config-file-path=/etc \
--enable-sqlite-utf8 \
--with-zlib-dir \
--with-libxml-dir \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-ttf \
--with-iconv \
--with-openssl \
--with-gettext \
--enable-mbstring \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--enable-static \
--enable-zend-multibyte \
--enable-inline-optimization \
--enable-sockets \
--enable-soap \
--enable-ftp \
--disable-ipv6
编译并安装
make && make install
cp php.ini-production /etc/php.ini
vim /usr/local/apache/conf/httpd.conf
找到 AddType application/x-gzip .gz .tgz 在下面添加如下内容
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
LoadModule php5_module modules/libphp5.so //检查是否存在
DirectoryIndex index.php index.html //调整首页文件设置
service httpd stop
service httpd start
进入到Apache目录 编写index.html
输入以下内容
<?php
phpinfo();
?>
将 index.html改为 php格式具体如下图测试
查看PHP测试页内容,如下图
标签:php
原文地址:http://blog.51cto.com/13620950/2121384