Poechant quick installation and configuration Tutorial: Apache + MySQL + PhP development environment in Windows 7

Source: Internet
Author: User

 

1. Download

 

To build a PHP environment in Windows 7 today, you must first download the PHP code package and the installation package for Apache and MySQL.

 

PHP version: php-5.3.6-Win32-VC9-x86.zip

: Http://windows.php.net/download/

(Be sure to download the thread safe version. Only this version has the Apache option .)

MySQL version: MySQL ver 14.14 distrib 5.5.12, for Win32 (x86)

: Http://www.mysql.com/downloads/mysql/

 

Apache version: httpd-2.2.18-win32-x86-openssl-0.9.8r-r2.msi

: Http://httpd.apache.org/download.cgi#apache22

(Note: OpenSSL indicates that the OpenSSL module is included. You can use OpenSSL to configure an SSL Secure link for Apache .)

 

2. Install the apache service in Windows 7

 

Double-click the installation package.

 

3. Install MySql in Windows 7

 

Double-click the installation package.

 

4. Configure PHP

 

4.1 decompress the zip package

 

Download PHP, decompress it to the C: root directory, and name the folder "php", that is, "C:/PHP ".

 

4.2 Modify file name

 

Locate php-development.ini and change its name to PhP. ini ".

 

4.3 modify the "php. ini" File

 

Find the following code snippet:

; On Windows:; extension_dir = "Ext" 

 

To:

; On Windows: extension_dir = "C:/PHP/EXT" 

 

Find the following code snippet:

Extension = php_curl.dll <br/> extension = php_gd2.dll <br/> extension = php_mbstring.dll <br/> extension = php_mysql.dll <br/> extension = extend <br /> extension = php_xmlrpc.dll <br/>

 

To:

Extension = php_curl.dll <br/> extension = php_gd2.dll <br/> extension = php_mbstring.dll <br/> extension = php_mysql.dll <br/> extension = extension <br/> extension = Extension 

 

Find the following code snippet:

; Session. save_path = "/tmp" 

 

To:

Session. save_path = "D:/phpsessiontmp" 

 

Find the following code snippet:

; Upload_tmp_dir = 

 

To:

Upload_tmp_dir = "D:/phpfileuploadtmp" 

 

Find the following code snippet:

; Date. timezone = 

 

To:

Date. timezone = Asia/Shanghai 

 

5. Configure Apache

 

Find the httpd. conf file under the conf directory in the Apache installation directory.

 

Find the following code snippet:

# Loadmodule vhost_alias_module modules/mod_vhost_alias.so 

 

Insert below:

Loadmodule php5_module "C:/PHP/php5apache2_2.dll" <br/> phpinidir "C:/PHP" <br/> addtype application/X-httpd-PHP. PHP. HTML. htm <br/> 

 

Find the following code snippet:

DocumentRoot "C:/program files/Apache Software Foundation/apache2.2/htdocs" <br/> 

 

To:

DocumentRoot "E:/phpweb" 

 

Find the following code snippet:

<Directory "C:/program files/Apache Software Foundation/apache2.2/htdocs"> 

 

To:

<Directory "D:/phpweb"> 

 

Find the following code snippet:

Directoryindex index.html 

 

To:

Directoryindex index. php index.html 

 

5. Restart the apache service.

 

Create a PHP file under "E:/phpweb/" and write the following content:

<? Php <br/> phpinfo (); <br/>?> 

 

Open "http: // localhost/" in the browser to view the PHP configuration page.

 

6. Configure MySQL

 

After installing MySQL, you can select all the default options as prompted to complete MySQL configuration.

 

7. Solution to failure to use localhost

 

Find the hosts file in the "C:/Windows/system32/Drivers/etc" directory, and remove the "#" header indicating the annotator in the following line.

#127.0.0.1 localhost 

 

8. You can install a program such as discuz, sablog, phpwind, or WordPress. If any problem occurs, refer to the following blog:

 

Http://blog.csdn.net/Poechant/archive/2011/05/14/6419895.aspx

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.