Apache+PHP环境搭建

阅读更多

Windows

1. 安装apache_2.0.59-win32-x86-no_ssl.msi

2. php-5.2.3-Win32.zip到E:\PHP

3. 复制E:\PHP\php.ini-dist到C:\Windows\php.ini

4. 复制E:\PHP\php5ts.dll到C:\Windows\system32

 

5. 修改Apache的配置文件httpd.conf,添加以下参数,让apache支持PHP

 

    LoadModule php5_module “E:/PHP/php5apache2.dll”
    AddType application/x-httpd-php .php 

 

6. PHP支持MySQL

(1)修改C:/WINDOWS/php.ini

    去掉注释

 

 

    extension=php_mysql.dll
    extension=php_mysqli.dll 

 

(2) 复制E:\PHP\libmysql.dll、E:\PHP\ext\php_mysql.dll、E:\PHP\ext\php_mysqli.dll到C:\Windows\system32下

 

Linux

1. 安装apache

 

    # tar zvxf httpd-2.2.3.tar.gz
    # cd httpd-2.2.3
    # ./configure –prefix=/usr/local/apache \
    –enable-module=most \
    –enable-shared=max
    # make
    # make install

    # /usr/local/apache/bin/apachectl start //启动Apache服务
    # /usr/local/apache/bin/apachectl stop //关闭Apache服务
    # /usr/local/apache/bin/apachectl restart //重启Apache服务 

 

2. 安装PHP 5.1.6

 

    # tar zvxf php-5.1.6.tar.gz
    # cd php-5.1.6
    # ./configure –prefix=/usr/local/php \
    –with-mysqld=/usr/local/mysql \
    –with-apxs2=/usr/local/apache/bin/apxs
    # make
    # make install
    # cp php.ini-dist /usr/local/php/lib/php.ini 
 

3. 配置Apache服务的httpd.conf (同上)

你可能感兴趣的:(PHP,Apache,MySQL,Windows,EXT)