How to build a website environment under Win7 Ultimate

  

How to set up a website environment under Win7 Ultimate

First, we must prepare the required software

Apache httpd-2.2.22-win32-x86-openssl-0.9.8t .msi

PHP php-5.3.10-Win32-VC9-x86.zip

MySQL mysql-5.5.20-win32.msi

Second, install the software

1. Installing Apache is very simple: Double-clicking the installation is no different from installing other Windows software. There is no special rule when filling in Server Infomation, as long as the input information conforms to the format;

2 After the installation is complete, enter http://localhost in the browser. If It Works! is displayed, it means the Apache installation is successful;

3. Install PHP: php-5.3.10-Win32-VC9-x86. Zip unzip to a directory;

4, install MySQL: double-click to install, if you need to change the installation directory, select Custom in the Choose Setup Type;

5, after the installation is complete, configure MySQL , all keep the default options, but it is best to change the MySQL default encoding to utf8, set the password in the Modify Security Settings option, lose Enter the password twice to complete, and finally Execute to complete the configuration;

Third, integrate Apache+PHP+MySQL

Apache: First modify the Apache configuration file, let Apache support parsing PHP files. The Apache configuration file is httpd.conf in the conf directory of the Apache installation directory.

1. Let Apache parse the php file and find it in the configuration file

#LoadModule vhost_alias_module modules/mod_vhost_alias.so

Add in the next line (the green location is based on PHP)

LoadModule php5_module "D:/Develop/PHP/php5apache2_2.dll"

PHPIniDir "D:/Develop/PHP"

AddType application/x-httpd-php .php .html .htm

2. Find

DirectoryIndex index.html

in the configuration file to

DirectoryIndex index.php index.html

3. Modify the Apache site directory, found in the configuration file (the directory installed by Apache is different, the displayed value is different)

DocumentRoot "D: /Develop/Apache2.2/htdocs"

Change to

DocumentRoot "D:/Workspace/PHP"

Find

and change to < Br>

PHP : Rename php.ini-development to php.ini as a PHP configuration file. Modify php.ini

1. Set the specific directory of the PHP extension package, find

; On windows:

; extension_dir = "ext"

Change to (the value is the directory of the ext folder)

; On windows:

extension_dir = "D:/Develop/PHP/ext"

2. Turn on the corresponding Library function, find the row of the library you need to open

;extension=php_curl.dll

;extension=php_gd2.dll

;extension=php_mbstring.dll

;extension=php_mysql.dll

;extension=php_xmlrpc.dll

Remove the preceding semicolon (comment), which is changed to

extension=php_curl. Dll

extension=php_gd2.dll

extension=php_mbstring.dll

extension=php_mysql.dll

extension=php_xmlrpc.dll

3. Set the time zone, find

;date.timezone =

to

date.timezone = Asia/Shanghai

Configuration is complete, check it out Whether the configuration is successful. Restart Apache, create a new file index.php in the site directory, enter the content:

phpinfo();

?>

Open your browser and enter http://localhost , the following is displayed, the installation is successful, and MySQL is successfully associated.

Copyright © Windows knowledge All Rights Reserved