Build php5.2 + apache2.2 in win7

Source: Internet
Author: User
Tags apache php administrator password

Configure Apache:

Back up httpd. conf to prevent errors.

1. Modify the document directory to: D:/Web
You need to modify the two items. Otherwise, an error occurs in Apache,
Modify DocumentRoot "C:/program files/Apache/htdocs"
DocumentRoot "D:/Web"
<Directory "C:/program files/Apache/htdocs">
<Directory "D:/Web">

Apache2 does not support the column file directory by default. You need to make the following changes:
<Directory/>
Options followsymlinks
...

Change
<Directory/>
Options indexes followsymlinks
...

2. Modify the default homepage
Search
<Ifmodule dir_module>
Directoryindex index.html
</Ifmodule>
Add the homepage to be supported after directoryindex index.html, such as PHP:
Directoryindex index.html default.html index. php default. php

3. modular PHP installation

Run php directly as a module of Apache. The location is random:
Loadmodule php5_module "C:/PHP/php5apache2_2.dll"
Phpinidir "C:/PHP"
Addtype application/X-httpd-PHP. php
Addtype application/X-httpd-PHP. html
The PHP module is loaded. The PHP zip package corresponds to three versions of Apache DLL, of which php5apache2_2.dll corresponds to apache2.2.

Apache configuration is complete here.

Configure PHP

1. Copy PHP. ini-development in the PHP Directory and rename it as PHP. ini.
Find; Extension = php_bz2.dll. Below is a long list of similar modules that can be selected for loading. you can load them as needed by removing the previous number. For example, I have loaded:
Extension = php_gd2.dll
Extension = php_mbstring.dll
Extension = php_mhash.dll
Extension = php_mime_magic.dll
Extension = php_ming.dll
Extension = php_mysql.dll
Extension = php_xmlrpc.dll
Extension = php_pdo.dll
Extension = php_sqlite.dll
Extension = php_pdo_sqlite.dll
Other things you may need
Find memory_limit = 128 MB. Modify the following values to limit the maximum memory size occupied by PHP scripts.
; Extension_dir = "C:/PHP/EXT" Remove the semicolon before this line (for php5.3)
Default Time Zone Problems
Date. timezone = Asia/Shanghai modify this line and add Asia/Shanghai

Save PHP. ini.

2. Add the PHP installation folder to the Windows system path. The specific method is: Computer --> Property --> advanced system property --> environment variable --> system variable --> path --> edit, add C:/PHP; C: to the variable value: /PHP/EXT. The specific path is modified according to your own situation. Finally, restart the computer.

PHP configuration is complete here

After Apache PHP is configured, save the configuration file to the desktop, select all files when saving, and write the configuration file suffix! The specific reason is unclear! Dizzy !!!!!

Install MySQL

1. Open the MySQL installation program, select Custom in the installation type, then select the installation address, and confirm the installation.
2. After the installation is complete, you will be asked if mysql.com sign-up is performed, that is, you will register an account on the official website. If you are willing to register, just skip this step without any impact. Then, check whether configure the MySQL server now, select and continue, and start configuring MySQL.
3. Select detailed configuration, that is, manual detailed configuration. Then select developer machine, because we are working as a Desktop Server and used for development and debugging, so select this one. Select the multifunctional database, which is the default one. Set InnoDB tablespace by default. If you adjust the settings, you must set them to the same for future Reinstallation, otherwise the database will be damaged. Of course, back up the database and it will be okay. Set the number of concurrent connections of the MySQL server. Because it is a desktop server, the default value is the first. You can also select the last one and enter the expected value. Set the port and mode. The default value is enough. Set the default database language encoding and select the second item utf8. Select the service and whether to add the MySQL installation directory to the system path. Set the administrator password. If the installation is resumed after the system is reinstalled, do not check anything here. After confirmation, the program is automatically configured and MySQL is enabled.

Apache Virtual Host

All we do is experiment environment, and you may also need to configure the virtual host. The steps below are to configure the Virtual Host:

Apache configuration file httpd. conf configuration

The default CONF/extra/directory of Apache contains the example of a VM. in the conf configuration file, enable the inclusion of the virtual host configuration file, which is generally in httpd. the end of the conf configuration file:

# Virtual Hosts
Include CONF/extra/httpd-vhosts.conf

Apache has strict syntax requirements on the httpd-vhosts.conf file, not a little error, comment out all the content in the original file, and then add the following content:

Namevirtualhost localhost // namevirtualhost can be specified only once. Do not specify other virtual host configurations. Otherwise, Apache may encounter an error.

<Virtualhost localhost> // The default directory is the root directory of the document directory.
DocumentRoot "D:/Web"
Servername localhost

<Directory 'd:/Web> // set the directory access permission
Options indexes followsymlinks
AllowOverride none
Order allow, deny
Allow from all
</Directory>

</Virtualhost>

 

<Virtualhost Notes>
DocumentRoot "D:/web/Notes"
Servername notes

<Directory 'd:/web/Notes> // Set Directory Access Permissions
Options indexes followsymlinks
AllowOverride none
Order allow, deny
Allow from all
</Directory>

</Virtualhost>

<Virtualhost ATT>
DocumentRoot "D:/web/att"
Servername ATT

<Directory 'd:/web/att>
Options indexes followsymlinks
AllowOverride none
Order allow, deny
Allow from all
</Directory>

</Virtualhost>

Finally, modify the system file host, which is located in the Windows/system32/Drivers/etc directory. Let the system parse our name, open the host file, and add the following content at the end of the file:
127.0.0.1 notes
127.0.0.1 ATT

In this way, you can directly enter notes or ATT in the browser to access our testing Website !!!

Save and restart the system.

The above is a record of my configured amp in win7. Record it. If it is reprinted, please indicate the source. Thank you !!

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.