Configure apache2.2 + php5.2.17 + MySQL environment in win7

Source: Internet
Author: User

When I was learning new technologies, it was really depressing to configure the environment. But fortunately, many of my friends on the Internet are very helpful to me.

1. install and configure Apache (install it to D: \ phpapache \ apache2.2)
1. It is installed by default during installation. For network domain and server name, enter my computer name and your email address in the Administrator's email address area.
2. After installation, there will be a conf folder in the installation directory. Open the httpd. conf file for configuration.
· Find DocumentRoot and set it to the folder where you want to store PHP, htm, and other web files, such as "D: \ phpapache \ apache2.2 \ htdocs ";
· Find the directoryindex, add index. php and index.htm after index.html, and separate it with a single space;
· Restart Apache and Use http: // localhost or http: // 127.0.0.1 or http: // yourcompanyname to test whether Apache is successful. If it succeeds, there will be an it works on the screen!

2. install and configure PHP (decompress the PHP compressed package to D: \ PHP \)
1. Modify PHP. ini

2. Change extension_dir to the directory where PHP/EXT is located, for example, "d: \ PHP \ Ext ";
3. Change doc_root to the same directory in step 1, for example, "d: \ phpapache \ apache2.2 \ htdocs ";

5. Remove the semicolon in the following sentence to better support MySQL and phpMyAdmin.
Extension = php_mbstring.dll
Extension = php_gd2.dll
Extension = php_mysql.dll

Third, PHP + Apache
1. Apache is allowed to run php programs as modules:
Open httpd. conf and add the following content (any location ):
Loadmodule php5_module "D:/phpapache/PHP/php5apache2_2.dll" (php5apache2. dll in apache2.0)

Addtype application/X-httpd-PHP. php
Addtype application/X-httpd-PHP. htm
(.Htm,. php can be used as the extension of the executable PHP language, and HTML, php3, PhP4, or even TXT can be added)

4. Restart the service
1. Find php5ts in D: \ PHP. DLL, libmysql. DLL copies it to c: \ winnt \ SYSTEM32 (winnt/2000), while WINXP/2003 copies it to c: \ windows \ system32

(If php cannot connect to MySQL after the 64-bit Windows 7, copy libmysql. DLL to the bin directory of Apache)
2. test whether the connection between APACHE and PHP is successful:
Start the start Apache service or restart the restart Apache
3. Create test. php under the web root directory (E: \ Program Files \ Apache Software Foundation \ apache2.2 \ htdocs)
<HTML>
<Head> <title> test </title> <Body>
<? PHP
Phpinfo ();
?>
</Body>
</Html>

4. Run http: // localhost/test. php
If it succeeds, you should see a webpage containing the PHP logo, which contains a lot of settings and other information.
Congratulations!

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.