Window 7/xp installing Apache 2.4 and PHP 5.4 in a detailed _php instance

Source: Internet
Author: User
Tags vc9
First, download the address
Apache 5.4--httpd-2.4.4-win32.zip
PHP 5.4--php-5.4.15-win32-vc9-x86.zip
Note that the PHP and Apache connector DLLs are already included in the VC9 thread-safe version, so you do not need to download this DLL.
Second, the configuration
1. Apache
Use any editor to open the apache2.4/conf/httpd.conf file to start the configuration.
1.1 Setting Apache Locations
Copy CodeThe code is as follows:
ServerRoot "D:/program files/apache2.4"

1.2 Enabling modules for use
I only removed the comments from the Mod_rewrite module.
1.3 Add the following content under module content
Copy CodeThe code is as follows:
LoadModule php5_module "D:/program files/php5.4, Php5apache2_4.dll"
AddType application/x-httpd-php. php
AddType application/x-httpd-php. html
AddHandler application/x-httpd-php. php
Phpinidir "D:/program files/php5.4"

1.4 Modifying the server administrator email address
Copy CodeThe code is as follows:
ServerAdmin info@yoursite.com

1.5 Modifying the document root directory
Copy CodeThe code is as follows:
DocumentRoot "E:/www"


1.6 Find the content replace the actual path
Copy CodeThe code is as follows:
scriptalias/cgi-bin/"D:/program files/apache2.4/cgi-bin/"


1.7 If you want to enable. htaccess Please modify Next content
Copy CodeThe code is as follows:
AllowOverride All

1.8 adding index.php to the index directory
Copy CodeThe code is as follows:
DirectoryIndex index.html index.php

2. PHP
1.1 Renaming Php.ini-development to PHP.ini
1.2 Modifying extension paths
Copy CodeThe code is as follows:
Extension_dir = "D:/program files/php5.4/ext"

1.3 Uncomment the following lines
Copy CodeThe code is as follows:
Extension=php_curl.dll
Extension=php_mysql.dll
Extension=php_mysqli.dll
Extension=php_pdo_mysql.dll
Extension=php_soap.dll

1.4 If you use PHP's mail function, please modify the following content
Copy CodeThe code is as follows:
SMTP = smtp.yoursite.com
Smtp_port = 25
Sendmail_from = youremail@sender.com

1.5 finally set the time zone
Copy CodeThe code is as follows:
Date.timezone = PRC

Third, installation
You need to install Apache 2.4 services into system services, start and run, enter CMD, and enter by line:
Copy CodeThe code is as follows:
CD D:/program Files/apache2.4/bin
Httpd.exe-k install-n "Apache24"

Write a index.php file with the contents of , launch the Apache service and visit the following http://localhost/.
  • 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.