Build apache+mysql+php development environment under Windows

Source: Internet
Author: User
Tags php development environment phpinfo sapi

Original: Windows Build apache+mysql+php development environment

Requirements

      • Essential knowledge

        Familiar with basic programming environment construction.

      • Operating Environment

        Windows 7 (64-bit);
        Apache2.2;
        MySQL Server 5.5
        php-5.3

      • Environment download

Official
    • Apache
    • Mysql
    • Php

As for the version I used has been uploaded to the Baidu Cloud to provide everyone download, here is not more verbose!!

Apache

Apache installation and normal application installation is not much different, the key is the configuration. Open the "conf\httpd.conf" file under the installation path, the file is our Apache configuration file.

Let Apache support PHP

LoadModule php5_module "D:/wamp/php-5.3.25/php5apache2_2.dll" AddType application/x-httpd-php. php Phpinidir "d:/wamp/php-5.3.25/"

The code location in the configuration file is as follows:

Check that the Web root directory is correct

DocumentRoot "E:/2015/wamp/apache2.2/htdocs"

Let Apache identify the index.php page

<ifmodule dir_module>    directoryindex index.html index.php</IfModule>

Test whether Apache is building successfully

Mysql

About MySQL installation, do not introduce here! Online tutorials are also more. is not in the children's shoes, I have been reproduced on the Internet two articles, please click on the link below to view.

    • MySQL5.5.21 installation Diagram
    • MySQL 5.6 Installation and configuration detailed illustrations

Test MySQL

Enter the following command in the DOS window to log in to MySQL

mysql-u[user name]-p[password]

Some simple operation instructions for MySQL

// connect MySQLmysql-h host address-u user name-P user Password // Change password mysqladmin-u user name-p old password password new password # Show commands // displays a list of databases in the current database server:mysql> show DATABASES; // display data tables in the database:mysql> use library name; MySQL> show TABLES; // display the structure of the data table:mysql> DESCRIBE table name;
Php

Unzip the compressed file into the specified folder (here you love how to complete the whole, below to provide my directory structure), PHP can be run in two ways: CGI (corresponding file Php5ts.dll file) and SAPI mode. Because we use Apache, so it is run as SAPI module, the corresponding file is Php5apache2_2.dll. Configure the php.ini file, PHP provides two templates, Php.ini-development and Php.ini-production, the former suitable for the development of program use (test), the latter has a high security settings, is suitable for online when the product use. Here we change the php.ini-development file to PHP.ini to make the configuration file use.

To modify the extension DLL file directory:

// here according to their actual situation Extension_dir = "E:\2015\wamp\php-5.3\ext"

Set Doc_root to the server root path:

// more personal situation Doc_root = "E:\2015\wamp\Apache2.2\htdocs"

To add an extension:

Choose which extensions you want to run, just remove the comments in front of extension, for example:

extension=php_mysql.dllextension=php_mysqli.dll
Test the installation Results

Create the phpinfo.php file under the server root path, with the following code:

<?php  phpinfo();?>

Browser input http://localhost/phpinfo.php. The following interface appears to be successful.

If the above articles or links are helpful to you, don't forget to click the "OK" button at the end of the article or click the "like a " button in the bottom right corner of the page. You can also click on the right side of the page " share " hover button Oh, let more people read this article.

Author: Li-cheng Weibo: http://weibo.com/licheng0426 Source: http://www.cnblogs.com/Li-Cheng/p/4381797.htmldue to my limited level, the article in terms of presentation and code if there is something wrong, welcome criticism. Leave your footprints, welcome to comment Oh. You can also pay attention to me, study together Oh! (^_^) If you think this article is helpful to you, let's enjoy a coffee bar, what's The DA (^_^)

Build apache+mysql+php development environment under Windows

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.