Development environment of PHP in Windows environment-full course of text _win server

Source: Internet
Author: User

The development environment of PHP based on Windows environment (apache+mysql+php)

First, preparatory work
Apache2.2.11
Download Address: http://www.apache.org
MySQL5.0
Download Address: http://www.mysql.com
PHP5.2.9
Download Address: http://www.php.net
Second, configure PHP

1. Extract the Php-5.2.9-win32.zip to the specified location (e.g. C:\ ), and change it to php[the following figure]
2, open the PHP folder, and the php.ini-dist renamed to php.ini[the following figure]

3, double click PHP.ini, enter to php.ini edit state

4, find Extension=php_gd2.dll and Extension=php_mysql.dll, and remove the semicolon before it (;), save the settings, and then close the file [image below]

5. Copy the Php_gd2.dll and Php_mysql.dll in the Php/ext folder to C:\Windows\System32

6, the PHP folder under the Libmysql.dll copy to C:\Windows\System32
7. Save Settings

Third, the installation of MySQL

1. Double-click the MySQL installation file, the following image shows the interface

2. Choose installation Type: Typical (Typical installation), custom (customized installation)

3. The system prompts you to follow the typical installation configuration as shown in the following illustration

4. Installation progress bar

5. Advertising 1

6. Advertising 2

7. Ask if you want to configure the MySQL server

Welcome interface for the 8.MySQL Server Configuration Wizard

9. Select configuration Type: Detailed (Detailed configuration), Standard (Standard configuration)

10. Select server Type: Developer Machine (Develop test class, MySQL takes up very little resources), "Server Machine (server type, MySQL occupies more resources)", "dedicated MySQL server Machine (dedicated database server, MySQL consumes all available resources) "


11. Choose the use of MySQL database: Multifunctional db (Universal multi-function, good) "," Transactional database only (server type, focus on transaction processing, general) "," Non-transactional database only (non-transactional processing, simpler, mainly to do some monitoring, counting, support for MyISAM data types limited to non-transactional)

12. InnoDB tablespace configuration, is to InnoDB database files to choose a storage space, if modified, to remember the location, when reloading to choose the same place, otherwise it may cause database damage.

13. Choose your site's general MySQL access, the number of simultaneous connections, "Decision Support (DSS)/olap (20)", "Online Transaction Processing (OLTP) (500 or so)", " Manual Setting (manually set, lose one number) "

14. Whether to enable TCP/IP connections, set the port, if not enabled, you can only access the MySQL database on their own machine

15. Set the MySQL default database language encoding

16. Choose whether to install MySQL as a Windows service, or specify service name (the name of the services identity), and whether to add MySQL's Bin directory to Windows PATH

17. Ask if you want to modify the default root user (super Admin) password (default is null)

18. Verify that the settings are correct, if wrong, press "back" to return to check. Press ' Execute ' to make the settings effective.

Four, install Apache
1, double click the Apache installation file, the following image shows the interface

2, confirm the approval of the Software Installation license regulations, select "I accept the terms in the license Agreement", point "Next" continue

3, the use of Apache installation to Windows instructions, please read the finished, press "Next" to continue
4, set up system information, fill in your domain name under the network domain (for example: wuhua.com), fill in your server name (for example: www.wuhua.com, that is, host name plus domain name), in the administrator ' s email address to fill in the system administrator's contact e-mail addresses (such as: admin@wuhua.com), the above three information for reference only, which contact e-mail address in the system when the failure to provide visitors, three of information can be arbitrarily filled out, invalid also line. There are two options for installing all users of the system, using the default 80 ports, and automatically starting as system services, and installing only for the current user, using port 8080, and manually booting. The general selection is shown in the figure. Press "Next" to continue.

5, choose the type of installation: Typical (typical installation), custom (customized installation)

6, choose the installed components and installation location
7. Specifies that the installation location is C:\apache, and of course the user can choose to customize the installation. If you choose to customize the installation, you omit the 6th, 7 steps

8. Returns the interface that the user just set

9. Confirm the settings, if the user feel what settings also need to be adjusted, you can click the "Back" button, and then reset, if the feeling set is correct, you can enter the click "Install" button to install!

10. The installation progress bar appears
11. Installation Complete

Under normal circumstances, the Apache icon appears in the lower right corner of the screen; and the color of this icon should be green, indicating that Apache has been running, but sometimes the red situation, which indicates that the Apache configuration in the process of error, there is no relationship, we will again to debug this error!
Five, configure Apache
1. Open the Apache configuration file-httpd.conf and open the method as shown below

2. Find the keyword "DocumentRoot" (that is, the site root directory), locate the following figure, and then change the address in the "" to your site root directory, address format according to the map, mainly the general file address "\" in Apache to change to "/".

3. Look for directory keywords, the directory location must be set to the same documentroot

4. Find the DirectoryIndex keyword, which is the name of the file that is displayed by default when you specify only the directory. Can add a lot, the system will be based on the order from left to right to the first display, separated by a single half-width space, such as the homepage of some sites is index.htm, at the cursor where the "index.htm" file name is arbitrary, does not necessarily have to "index.html", such as " Test.php "And so on, all can.
5. Find LoadModule keyword and add the following statement
Php5_module "C:\php\php5apache2_2.dll"

Phpinidir "c:\php"
AddType application/x-httpd-php. php

6. Specify the port number that the Apache server listens to listen 8080

7. Save settings and restart Apache
VI. Installation and Testing
Create a text file in the home directory, and then double-click the edit state to enter the file, adding the following statement

<?php
Phpinfo ();
?>

After you save the file, rename it to index.php

Start the browser and enter http://127.0.0.1:8080 in the address bar
If the user sees the following interface, it is proved that the Apache environment has been built, now can start the PHP tour ...

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.