Windows 7/XP installs Apache 2.4 with PHP 5.4 process detailed _php instance

Source: Internet
Author: User
Tags vc9 win32
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 there is no need to download this DLL.
Second, the configuration
1. Apache
Use any editor to open the apache2.4/conf/httpd.conf file to start configuration.
1.1 Set Apache location
Copy Code code as follows:

ServerRoot "D:/program files/apache2.4"

1.2 Enable the use of the module
I only removed the annotation for the Mod_rewrite module.
1.3 Add the following content under the module content
Copy Code code 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 Modify server Administrator email address
Copy Code code as follows:

ServerAdmin info@yoursite.com

1.5 Modifying the document root directory
Copy Code code as follows:

DocumentRoot "E:/www"
<directory "E:/www" >

1.6 Find the content replace the actual path
Copy Code code as follows:

scriptalias/cgi-bin/"D:/program files/apache2.4/cgi-bin/"
<directory "D:/program Files/apache2.4/cgi-bin" >

1.7 If you want to enable. htaccess Please modify <directory "d:/www" > Content
Copy Code code as follows:

AllowOverride All

1.8 Add index.php to index directory
Copy Code code as follows:

DirectoryIndex index.html index.php

2. PHP
1.1 renaming Php.ini-development to PHP.ini
1.2 Modifying the extended path
Copy Code code as follows:

Extension_dir = "D:/program files/php5.4/ext"

1.3 Uncomment the following line
Copy Code code 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 the PHP Mail function please modify the following content
Copy Code code as follows:

SMTP = smtp.yoursite.com
Smtp_port = 25
Sendmail_from = youremail@sender.com

1.5 Last set the next time zone
Copy Code code as follows:

Date.timezone = PRC

Third, installation
The Apache 2.4 service needs to be installed in the system service, start-> run, enter cmd, and then enter by line:
Copy Code code as follows:

CD D:/program Files/apache2.4/bin
Httpd.exe-k install-n "Apache24"

Write a index.php file, the content is <?php phpinfo (), Start Apache service, visit the following http://localhost/bar

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.