Configure the PHP environment on Windows

Source: Internet
Author: User
Tags apache windows mysql download
In Windows, it is very convenient to configure the PHP environment phpnow in Windows, but the compatibility is not very good. sometimes we need to manually configure the PHP environment in Windows, manual configuration is troublesome and you often forget the configuration steps. Therefore, the configuration process is recorded specially today. First, we need to download: configure the PHP environment in apache Windows

Phpnow is very convenient to configure the environment in Windows, but it is not very compatible. sometimes we also need to manually configure the PHP environment in Windows, manual configuration is troublesome and often forget the configuration steps. Therefore, the configuration process is recorded specially today.

First, we need to download:

Apache official website:

Http://httpd.apache.org/download.cgi

Official mysql download location:

Http://dev.mysql.com/downloads/mysql/5.0.html#win32

Php official: http://www.php.net/downloads.php

Official: phpMyAdmin http://phpmyadmin.com/

?

The required software is downloaded, next I want to install, click the apache_2.0.59-win32-x86-no_ssl.msi, apache default port we choose 80, there is not conflict with the IIS port number. Installation with Common applications

And similar. After the program is installed, enter http: // 127.0.0.1 in the browser to view the title "install Apache test", indicating that apache is successfully installed.

?

Mysql installation:

Run setup.exe under the mysqlfolder. You need to set the password step. generally, do not leave the password blank (for example, set the password to 123456 ). Click next and Finish. Our database has been installed.

?

PHP installation configuration:

We decompress php-5.2.3-win32.zip to the C root directory and change the folder name to PHP for convenience. Find "PHP. ini-dist "or" php. ini-recommended. ini ", copy to" C: \ WINDOWS.

Copy php5ts. dll from the php directory to the "C: \ WINDOWS \ system32" directory.

Copy "php_gd2.dll" and "php_msql.dll" under the php \ ext directory to the "C: \ WINDOWS \ system32" directory.

Modify httpd. conf of apache: find the "httpd. conf" file under E: \ Apache2 \ conf (you 'd better back up it in advance ).

Find DocumentRoot and change it to the root directory of your website, such as "DocumentRoot" E:/Apache2/htdocs "";

Find DirectoryIndex index.html. var and add index. php

Find # LoadModule ssl_module modules/mod_ssl.so and add a row to LoadModule php5_module c: \ php \ php5apache2. dll;

Find AddType application/x-gzip.gz.tgz followed by AddType application/x-httpd-php.php;

Write a file index. php, add "" to the apache root directory, start from the apache server, enter: http: // 126.0.0.1/index in the browser. php: the php configuration is displayed. The php version indicates that the php configuration is successful.

?

Mysql configuration:

Open the c: \ windows \ php. ini file;

Search; extension = php_mysql.dll, remove ';' comment;

Search; extension = php_gd2.dll, remove ';' comment;

Search; extension = php_mbstring.dll, remove ';' comment;

Query; session. save_path = "/temp", remove ";", and change "/temp" to "C: \ WINDOWS \ Temp ";

Search; change extension_dir to extension_dir = "c: \ php \ ext ";

Copy libmysql. dll to the "c: \ windows \ system32" directory.

Search; extension = php_mysql.dll, remove ';' comment;

Restart the apache server.

?

Install and configure phpMyAdmin:

Decompress phpMyAdmin to the apache root directory (E: \ apache \ hotdocs) and modify E "\ apache \ htdocs \ phpMyAdmin \ config. inc. php file, set the user name and password (the user name and password we set when installing mysql ). enter http: // 127.0.0.1/phpMyAdmin/in the browser to conveniently manage our database.

?

Configure the apache virtual directory:

Open the C: \ WINDOWS \ system32 \ drivers \ etc \ hosts file and add 127.0.0.1 ceshi.com

Open the E: \ apache \ htdocs \ httpd. conf file

Find # NameVirtualHost *: 80 and remove "#";

?

ServerAdmin nide@gmail.com // your mailbox

DocumentRoot E:/www/web // your virtual path address

ServerName ceshi.com // URL of the virtual path

ErrorLog logs/dummy-host.ceshi.com-error_log

CustomLog logs/dummy-host.ceshi.com-access_log common

?

To set multiple virtual paths, you only need to copy them. To Change the content you need.

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.