Apache2 supports PhP5 Configuration

Source: Internet
Author: User

Software Version

Apache 2.2.3

Php5.2.17 zip

 

Note: During the download process, for Apache to download the thread-safe version (vc6 thread-safe)

 

Installation Procedure [modify the following path based on the actual installation conditions]

1. install Apache and click Next. To the end.

2. Decompress PHP to drive, for example, D: \ PhP5.

3. Modify the PHP configuration: php. ini

Find PHP. ini-Dist in the D: \ PhP5 directory and change the name to PhP. ini.

Rename PHP. ini-Dist to PhP. ini.
 
Find
extension_dir = "./"
Change
extension_dir = "D:/PHP5/ext"
 
Find
;extension=php_mbstring.dll
;extension=php_mysql.dll
;extension=php_gd2.dll
Change
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_gd2.dll
 
Find
;date.timezone =
Change
date.timezone = Asia/Shanghai
(Time Zone see http://us3.php.net/manual/en/timezones.asia.php)
 
Create a session folder in the PHP Directory
 
Find
;session.save_path = "/tmp"
Change
session.save_path = "D:/PHP5/session"
 
=================================================================

 

 

Modify Apache configuration: httpd. conf
 
Create a folder named wwwroot on disk D (default website directory)
 
Find
DocumentRoot "D:/Apache/htdocs"
Change
DocumentRoot "D:/wwwroot"
 
Find
<Directory "D:/Apache/htdocs">
Change
<Directory "D:/wwwroot">
 
Find
DirectoryIndex index.html
Change
DirectoryIndex index.html index.htm index.php
 
Find
#LoadModule ssl_module modules/mod_ssl.so
Add
LoadModule php5_module "D:/PHP5/php5apache2_2_filter.dll"
 
Add the following statement at the end of the httpd. conf file
# PHP5
PHPIniDir "D:/PHP5"
ScriptAlias /php/ "D:/PHP5/"
Action application/x-httpd-php "/php/php-cgi.exe"
AddType application/x-httpd-php .php

 

====================================

 

Write a test file index. php

 

<? PHP phpinfo ();?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.