Build an Apache + MySQL + PhP environment on Windows

Source: Internet
Author: User
Tags fully qualified domain name

The network chat room set up a few days ago uses the Apache + MySQL + PhP environment to record the building process.

1. Download Software
Apache
Httpd-2.2.22-win32-x86-no_ssl.msi http://httpd.apache.org/download.cgi
In Windows, there are two binary installation files: No-SSL and OpenSSL. OpenSSL adds SSL authentication, which is used to build an HTTPS website. Generally, download no-SSL.
PHP
Php-5.3.10-Win32-VC9-x86.zip http://windows.php.net/download/
PHP has ZIP files and MSI files in windows. Select ZIP files here because the configuration is more comfortable.
MySQL
Mysql-installer-5.5.20.0.msi http://dev.mysql.com/downloads/

2. installation and configuration
PHP
Decompress it to the D: \ php-5.3.10 directory, rename the php. ini-production file to PhP. ini, and open and modify the following:
Locate extension_dir and set it to extension_dir = "D:/php-5.3.10/EXT ""
Find the following extension line and remove the semicolon
; Extension = php_gd2.dll
; Extension = php_mbstring.dll
; Extension = php_mysql.dll
; Extension = php_mysqli.dll
Add system environment variable: D: \ php-5.3.10; D: \ php-5.3.10 \ ext
Note: it must be a system environment variable, not the current user environment variable.
Apache
After successful installation, open the file D: \ Program Files \ Apache Software Foundation \ apache2.2 \ conf \ httpd. conf and make the following changes:
Add the following statement directly at the end of the file
Loadmodule php5_module D:/php-5.3.10/php5apache2_2.dll
Phpinidir D:/php-5.3.10
Addtype application/X-httpd-PHP. php
Find row
Directoryindex index.html
Add index. php
Directoryindex index.html index. php
MySQL
After MySQL is installed, only localhost: 3306 and 127.0.0.1: 3306 can be used by default. To access MySQL through an IP address, you must configure the access permission. Open MySQL workbench, log on to the database, add a user to security-> Users and privileges, and enter "%" in limit connectivity to hosts matching on the login tab ", you can use this account to log on to the PC on other networks in the future.

After configuring the environment, test whether Apache is started properly. Choose Start> Apache HTTP Server 2.2> Configure Apache Server> test configration, if an error occurs, you can see the prompt.

3. Test
Create index. php,

<?php    phpinfo();?>

Place index. php In D: \ Program Files \ Apache Software Foundation \ apache2.2 \ htdocs and enter http: // localhost/index. php In the browser to display PHP-related information.

PS1
At the beginning, decompress PHP to the D:/program files/php-5.3.10/directory, the test found that as long as the loadmodule php5_module D:/program files/php-5.3.10/php5apache2_2.dll is added, Apache fails to start, tip:
The requested operation has failed!
The solution found on the internet is that there are spaces in the path. After you place PHP in a new location, it can be started normally.

PS2
The following error occurs in Apache error. log:
Httpd.exe: cocould not reliably determine the server's fully qualified domain name, using 192.168.1.188 for servername
Add at the beginning of the httpd. conf file
Servername localhost: 80
That's all.

Related Article

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.