Apache Http Server+PHP配置

软件包:httpd-2.2.17.tar.gz + php-5.3.8.tar.gz + MySQL-devel-community-5.1.61-1.rhel5.i386.rpm

一、安装apache服务器

    1.#tar zxf httpd-2.2.17.tar.gz

    2.#cd httpd-2.2.17

    3.#./configure --prefix=/usr/local/apache-httpd --enable-module=so --enable-module=rewrite

    4.#make&&make install

    5.#cd /usr/local/apache-httpd/bin

    6.启动apache http server,./apachectl -k start

二、安装php

    1.#rpm -ivh MySQL-devel-community-5.1.61-1.rhel5.i386.rpm

    2.#tar zxf php-5.3.8.tar.gz

    3.#cd php-5.3.8

    4.#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache-httpd/bin/apxs --with-mysql=/usr/include/mysql

    5.#make&&make install

    6.vi /etc/syscnfig/selinux,SELINUX=disabled

    7.chcon -t texrel_shlib_t /usr/installed/apache-httpd/modules/libphp5.so

    8.修改/conf/http.conf,加入如下内容:

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

    9.重启apache http server,./apachectl -k restart

    10.在htdocs下放一个phpinfo.php文件测试下即可

<?php
    phpinfo();
?>

 

你可能感兴趣的:(Apache Http Server+PHP配置)