1、在自己的服务器上安装apache+php+mysql
下载apache,php,mysql
安装apache:
./configure --prefix=/home/tianyong.wang/sys/apache --enable-module=so
make -j 8
make install
安装php:
./configure --prefix=/home/tianyong.wang/sys/php --with-apxs2=/home/tianyong.wang/sys/apache/bin/apxs --with-mysql --enable-mbstring --enable-sigchild
(可以附带更多的选项:./configure –prefix=/usr/local/php –with-mysql=/usr/local/mysql –enable-force-cgi-redirect –with-freetype-dir=/usr –with-png-dir=/usr –with-gd –enable-gd-native-ttf –with-ttf –with-gdbm –with-gettext –with-iconv –with-jpeg-dir=/usr –with-png –with-zlib –with-xml –enable-calendar –with-apxs=/usr/local/apache/bin/apxs)
make -j 8
make test
make install
cp php.ini-dist(php.ini-recommended) ~/sys/php/etc/php.ini
2、修改apache的配置文件
安装php的时候会在httpd.conf文件自动添加一行记录 LoadModule php5_module modules/libphp5.so
Listen 8090(防止和其他apahce进程冲突)
DirectoryIndex index.html index.php index.htm
AddType application/x-httpd-php .php
PhpIniDir /home/tianyong.wang/sys/php/etc/php.ini
3、启动
apachectl -k start|restart|stop