Win7 Configuring the Apache+php+mysql environment

Source: Internet
Author: User
Tags configuration php
First, install and configure Apache (install to D:\phpapache\Apache2.2)
1, install the default installation, Network Domain, Server name I fill in My Computer name, Administrator ' s email address area fill your email addresses
2, after installation in the installation directory has a conf folder, open the httpd.conf file for configuration
• Find DocumentRoot, set it as the folder you want to store PHP, HTM and other Web files, such as "D:\phpapache\Apache2.2\htdocs";
• Find DirectoryIndex, add index.php, index.htm and so on after index.html, separate it with a single space;
• Restart Apache to test for success with http://localhost or http://127.0.0.1 or http://yourcompanyname. The success of the words screen will have an IT works!

Second, install the configuration PHP (decompression PHP compression package to d:\php\)
1. Rename the php.ini-recommended file to php.ini and cut it to the directory where the system is located (such as 2000/nt winnt/system32, xp windows/system32 directory),
2, change the Extension_dir to Php/ext directory, such as "D:\php\ext";
3, the doc_root changed to the same directory in the first step, such as "D:\phpapache\Apache2.2\htdocs";
4, find; Session.save_path = "/tmp", will '; ' Remove, set the directory where you saved the session, such as Session.save_path = "d:/php/session_temp";
5. Then remove the semicolon in front of the following sentence to better support MySQL and PHPmyadmin
Extension=php_mbstring.dll
Extension=php_gd2.dll
Extension=php_mysql.dll

Third, install the configuration PHP (decompression PHP compression package to d:\php\)
1. Rename the php.ini-recommended file to php.ini and cut it to the directory where the system is located (for example, in 2000/nt winnt, xp Windows directory),
2, change the Extension_dir to Php/ext directory, such as "D:\php\ext";
3, the doc_root changed to the same directory in the first step, such as "D:\phpapache\Apache2.2\htdocs";
4, find; Session.save_path = "/tmp", will '; ' Remove, set the directory where you saved the session, such as Session.save_path = "d:/php/session_temp";
5. Then remove the semicolon in front of the following sentence to better support MySQL and PHPmyadmin
Extension=php_mbstring.dll
Extension=php_gd2.dll
Extension=php_mysql.dll

IV, Php+apache
1. Allow Apache to run the PHP program as a module:
Open httpd.conf and add the following (any location):
LoadModule php5_module "D:/phpapache/php/php5apache2.dll"

AddType application/x-httpd-php. php
AddType application/x-httpd-php. htm
(. htm,. php Extensions for executable PHP languages, plus HTML, php3, PHP4, and even txt)
(The following two steps may not be required)
2. If you need to run a PHP program in CGI mode for some reason (using Php.exe),
Please turn the above line into a comment (each outfit adds #) and add the following lines:
# scriptalias/php/"d:/phpapache/php/"
# AddType application/x-httpd-php. php
#Action application/x-httpd-php "/php/php-cgi.exe"
3, now Apache 2 support HTML and not support PHP, first add the following sentence to d:\apache2\conf\httpd.conf:
# scriptalias/php/"d:/phpapache/php/"
# AddType application/x-httpd-php. php
#Action application/x-httpd-php "/php/php-cgi.exe"

Five, re-start the service
1, found in the D:\PHP php5ts.dll,libmysql.dll copy it to C:\Winnt\System32 (winnt/2000 machine), and winxp/2003 is copied to C:\Windows\System32
2. Test whether Apache and PHP are connected successfully:
Start the start Apache service or restart restart Apache if it is running
3. Create a new test.php (i.e. E:\Program files\apache software Foundation\apache2.2\htdocs) under the Web root directory

Test

Phpinfo ();
?>

4. Running http://localhost/test.php
If successful, you should see a Web page with a PHP logo that contains a number of settings and other information

  • 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.