下载以下安装包
apr-1.4.5.tar.gz
apr-util-1.3.12.tar.gz
httpd-2.4.18.tar.gz
libgd-gd-2.1.1.tar.gz
libmcrypt-2.5.7.tar.gz
mysql-5.1.73.tar.gz
php-5.5.33.tar.gz
pcre-8.10.zip
mysql 编译:
./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-unix-socket-path=/var/lib/mysql/mysql.sock --enable-thread-safe-client --with-plugins=partitionapr 编译
./configure
apr-util 编译
./configure --with-apr=/usr/local/apr
httpd 编译
./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --enable-module=all --enable-shared=max --enable-cgi
libgd 编译
./configure --prefix=/usr/local/gd
php 编译
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-xpm-dir=/usr/lib64/ --with-libxml-dir=/usr/lib64 --with-mysqli=/usr/local/mysql/bin/mysql_config --with-gd=/usr/local/gd --with-png-dir=/usr/lib64 --with-jpeg-dir=/usr/lib64 --with-zlib --with-freetype-dir=/usr/lib64 --with-apxs2=/usr/local/apache2/bin/apxs --with-curl=/usr/lib64 --enable-fastcgi --enable-force-cgi-redirect --with-mcrypt=/usr/local/mcrypt
make时报错:
php-5.5.33/ext/gd/gd.c:57:22: error: X11/xpm.h: No such file or directory
从
http://vault.centos.org/6.2/os/x86_64/Packages/
下载并安装libXpm-devel-3.5.8-2.el6.x86_64.rpm
rpm -ivh libXpm-devel-3.5.8-2.el6.x86_64.rpm
配置httpd
进入/usr/local/apache2/conf配置httpd.conf,
修改Listen 项目,加入端口
修改ServerName项目,加入域名
加入解析PHP的配置:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html
另外检查是否存在LoadModule php5_module modules/libphp5.so