Installing and configuring PHP + Apache on Windows systems

Source: Internet
Author: User
Tags configuration php

Reference: http://www.cnblogs.com/pharen/archive/2012/02/06/2340628.html

I had a PHP class when I was in college, because the class needed to be configured once php+mysql+apache. Thought I would never touch it again.

I never thought I'd have to touch PHP again for four years to work.

This installation is a real hassle.

This article aims to: Install the configuration php+ Apache.

Version and

PHP php-5.6.6-win32-vc11-x64 http://windows.php.net/download#php-5.6

Apache Apache 2.4 http://www.apachehaus.com/cgi-bin/download.plx (no MSI installed version)

After downloading the Apache compressed package, unzip it. The following steps are intended to test whether the Apache server is booting properly.

1. Start Cmd.exe with administrator privileges

2. Files directory of Apache after CD decompression/bin/

3. Httpd-k Install

1. If the following error message appears, you will need to configure the Apache directory/config/httpd.conf file.

Open httpd.conf file to find ServerRoot and change its contents to the current Apache directory as

Then save the modified httpd.conf and restart Apache. (in cmd input httpd-k restart)

4. Start ApacheMinitor.exe under the Bin directory, when you see that the Apache server is turned on.

5. Enter the http://localhost page on the browser to indicate that the configuration was successful.

Then the task is to link Apache and PHP, so that Apache can parse PHP files. By modifying the configuration file.

Apache: Configuration file httpd.conf in the Conf directory of the Apache installation directory.

1. Allow Apache to parse the PHP file and locate it in the configuration file

#LoadModule Vhost_alias_module modules/mod_vhost_alias.so

Add on the next line (the green location is based on the directory where PHP is located)

LoadModule php5_module "d:/develop/php/php5apache2_4.dll"
Phpinidir "d:/develop/php"
AddType application/x-httpd-php. php. html. htm

2. Found in the configuration file

DirectoryIndex index.html

Switch

DirectoryIndex index.php index.html

3. Modify the Apache Site Directory, found in the configuration file (Apache installed directory, different values displayed)

DocumentRoot "d:/develop/apache2.2/htdocs"

Switch

DocumentRoot "d:/workspace/php"

      

Find it again.

<directory "d:/develop/apache2.2/htdocs" >

Switch

<directory "d:/workspace/php" >

PHP: Renamed Php.ini-development to php.ini as a PHP configuration file. Modify PHP.ini

1. Set the specific directory for the PHP expansion pack to find

; On Windows:
; Extension_dir = "ext"

Change to (value is the directory of Ext folder)

; On Windows:
Extension_dir = "d:/develop/php/ext"

2. Turn on the library function to locate the row of the library you want to open

; Extension=php_curl.dll

; Extension=php_gd2.dll

; Extension=php_mbstring.dll

; Extension=php_mysql.dll

; Extension=php_xmlrpc.dll

Remove the preceding semicolon (note) and change to

Extension=php_curl.dll

Extension=php_gd2.dll

Extension=php_mbstring.dll

Extension=php_mysql.dll

Extension=php_xmlrpc.dll

      

3. Set the time zone to find

;d Ate.timezone =

Switch

Date.timezone = Asia/shanghai

       

Configuration is complete to detect the success of the configuration. Restart Apache, in the Site directory, create a new file index.php, enter the content:

<?php
Phpinfo ();
?>

Open the browser input http://localhost, display the following content, the installation was successful, and successfully associated with MySQL.

Installing and configuring PHP + Apache on Windows systems

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.