CentOS6.5系统搭建php服务器

分类:CentOS运维 阅读:4316 次

下面我们开始编译安装PHP5.4.33

首先下载源码包到用户目录下,下载PHP5.4.33

也可以使用命令行下载:

wgethttp://kr1.php.net/get/php-5.4.33.tar.bz2/from/this/mirror-O php-5.4.33.tar.bz2

tar-jxvfphp-5.4.33.tar.bz2

安装php需要的一些包

yum-yinstalllibmcryptlibmcrypt-develbzip2-devellibxml2libxml2-devellibcurl.x86_64libcurl-devel.x86_64

[root@diguojin~]#cd/usr/local/src/php-5.4.33/ [root@diguojinphp-5.4.33]#./configure--prefix=/usr/local/php-5.4.33\ --with-mysql=/usr/local/mysql-5.5.40/\#MySQL安装目录 --with-openssl=/usr/local/openssl-1.0.1i/\#OpenSSL安装目录 --with-mysqli=/usr/local/mysql-5.5.40/bin/mysql_config\ --with-freetype-dir\ --with-jpeg-dir\ --with-png-dir\ --with-zlib\ --with-libxml-dir\ --with-apxs2=/usr/local/httpd24/bin/apxs\#指向Apache安装目录下/bin/apxs --with-mcrypt\ --with-config-file-path=/etc\ --with-config-file-scan-dir=/etc/php.d\ --with-bz2\ --enable-xml\ --enable-sockets\ --enable-maintainer-zts\ --enable-mbstring

[root@diguojinphp-5.4.33]#make&&makeinstall

vim/etc/httpd24/httpd.conf

添加如下两行

AddTypeapplication/x-httpd-php.php

AddTypeapplication/x-httpd-php-source.phps

定位至DirectoryIndex index.html

修改为

DirectoryIndexindex.phpindex.html