Apache2.2.8 + php5.2.6 + mysql5 installation and configuration in Windows

Source: Internet
Author: User

The "robot dog" of the dog's day ran to my computer and fought for three hundred rounds. A hard disk. It took more than an hour to back up dozens of GB of data to my pangu server. In addition to installing a lot of software, the PHP environment also needs to be re-installed. Record it by the way.

First, download the three software. The addresses are as follows:
Apache: http://httpd.apache.org/download.cgi
MySQL: http://dev.mysql.com/downloads/
PHP: http://www.php.net/downloads.php

I downloaded a full set of the latest, but they are all "advanced" equipment. Apache2.2.8, mysql5.0.51a, and php5.2.5. MySQL is the noinstall version. Installation starts...

Install apache2.2.8
The homepage is installed with apache2.2.8. This is relatively simple. You can simply double-click it and press enter all the way.
After the installation, open your browser and enter "localhost" or "127.0.0.1". If you can see the "It works !", The installation is successful.

Install and configure mysql5
First, extract the downloaded MySQL file to the location you want to install, such as: D:/MySQL
Go to the MySQL folder and you will see several INI files under the folder:
My-huge.ini
My-innodb-heavy-4G.ini
My-large.ini
My-medium.ini
My-small.ini
This is an optimized configuration file officially provided. You can select one as needed and copy it to C:/windows and rename it my. ini. Open my. ini and add the following configuration code:

# Set the MySQL installation directory basedir = D:/MySQL # Set the MySQL data directory datadir = D:/MySQL/Data

This code must be added. Otherwise, MySQL cannot be started and the error "1067" is prompted. The following path must be flexibly processed.
Next, go to the "dos" window and use the command line to enter the bin directory of MySQL. Enter the following command:

mysqld --install

This command is used to add MySQL to the Windows service. If the prompt "service successfully installed" is displayed after the command is run, the instance is successfully added. Do not believe that you go to the "service" of "Management Tools" to check whether there must be more MySQL services. Check if it has been started. If it has not been started, start it manually.

 

Install and configure php5.2.6
PHP is relatively simple. Like MySQL, first extract the compressed file to the installation location and then to the PHP Directory. There are two files: "php. ini-Dist" and "php. ini-recommended ". These two files have different purposes.

PHP. ini-Dist is suitable for development programs
PHP. ini-recommended has high security settings and is suitable for product launch.

Select one as needed, copy and rename it PHP. ini. Select the location. It will be used to configure Apache later.
After the installation is complete, go to the Apache installation directory, open the httpd. conf file in the conf folder, and add the following settings.

# Load PHP processing module loadmodule php5_module D:/PHP/php5apache2_2.dll # Set phpinidir D:/PHP # Add the PHP file connection addtype application/X-httpd-PHP. php

Search for "directoryindex". The default document is added, and "index. php" is added later ".

 

I restarted Apache and wrote a PHP file to test it. <? PHP phpinfo ();?> . The installation is successful.

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.