Build an Apache + Mysql + PHP development environment in windows, apachemysql

Source: Internet
Author: User
Tags php development environment sapi

Build an Apache + Mysql + PHP development environment in windows, apachemysql
Requirements

    • Required knowledge

      Familiar with basic programming environment setup.

    • Running Environment

      Windows 7 (64-bit );
      Apache2.2;
      MySQL servers 5.5
      Php-5.3

    • Environment download

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:

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 successfully built.

Mysql-u [user name]-p [Password]

// Connect to MYSQLmysql-h host address-u user name-p User password // Change password mysqladmin-u user name-p old password new password # display command/display in the Current Database Server database List: mysql> show databases; // display the data table in the database: mysql> USE Database Name; mysql> show tables; // display the data table structure: mysql> DESCRIBE table name;PHP

Decompress the compressed file to the specified folder (here you can try it out, and provide my directory structure below). php can run in two ways: CGI (corresponding file php5ts. dll files) and SAPI. Because Apache is used, it is run in the SAPI module. The corresponding file is php5apache2_2.dll. Configure php. INI file. php provides two templates: php. ini-development and php. ini-production: the former is suitable for development programs (for testing), and the latter has high security settings, which is suitable for product launch. Here we will change the php. ini-development file to php. ini for the configuration file.

// Here according to your actual situation and extension_dir = "E: \ 2015 \ wamp \ php-5.3 \ ext"

Set doc_root as the server root path:

// Doc_root = "E: \ 2015 \ wamp \ Apache2.2 \ htdocs" depends on your actual situation"

 

Add extension:

To select the extensions to run, you only need to remove the comments before extension. For example:

extension=php_mysql.dllextension=php_mysqli.dll
Test installation result

Create the phpinfo. php file in the root path of the server. The Code is as follows:

<?php  phpinfo(); ?>

Enter http: // localhost/phpinfo. php In the browser. If the following interface appears, the operation is successful.

"Not bad" button or click "like" in the lower right corner of the page. You can also click the "share" floating button on the right side of the page to let more people read this article.

Author: Li-Cheng Weibo: http://weibo.com/lichen?426. Leave your footprints. Comments are welcome. You can also follow me and learn together! (^_^) If you think this article is helpful to you, you can have a cup of coffee)

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.