Build a PHP development environment in Windows 7

Source: Internet
Author: User
Tags php development environment
Build a PHP development environment in Windows 7. Part 1: install Apache2.4.4

1. Download File: httpd-2.4.4-win32-ssl_0.9.8.zip

2. unzip and install: Copy the Apache24 folder to the C root directory.

3. open the httpd. conf file under the C: \ Apache24 \ conf folder and use notepad to open it.

4. remove the "#" sign before the ServerName in line 2;

5. change DocumentRoot "c:/Apache24/htdocs" to "E:/WorkSpace/WWW"

238th rows Change to "E:/WorkSpace/WWW">

Note: the WWW folder is the root directory of the website and must be created by yourself. Otherwise, an error is reported.

7. change DirectoryIndex index.html to DirectoryIndex index. php index.html index.htm.

Part 2: install PHP5.4.15

1. Download File: php-5.4.15-Win32-VC9-x86.zip

2. unzip and install: extract the file, copy it to the C root directory, and change it to PHP54.

3. copy php. ini-development and change it to PHP. ini.

4. open the httpd. conf file under the C: \ Apache24 \ conf folder and add the following information under # LoadModule xml2enc_module modules/mod_xml2enc.so.

LoadModule php5_module "C:/PHP54/php5apache2_4.dll"PHPIniDir "C:\PHP54"AddType application/x-httpd-php .php .html .htm

5. create index. php in the WWW folder. the file content is as follows:

Test PHP5
 
  This is test information
 
 


6. start Apache Server: start it in the cmd window (the window cannot be closed during the test; otherwise, the service will stop)

7. enter http: // localhost/in the browser. if the following information appears, the configuration is successful.

NOTE: 1. let php support MySQL:

Change row 730th; extension_dir = "C: \ PHP54 \ ext" to extension_dir = "C: \ PHP54 \ ext" to rows 880th and 881; extension = php_mysql.dll; extension = php_mysqli.dll to extension = php_mysql.dllextension = php_mysqli.dll

2. Add Apache to the system service:

Add Service:

"C:\Apache24\bin\httpd.exe" -k install -n "Apache 2.4.4" -f "C:\Apache24\conf\httpd.conf"

Delete service:

"C:\Apache24\bin\httpd.exe" -k uninstall -n "Apache 2.4.4"

Start Service:

"C:\Apache24\bin\httpd.exe" -k start -n "Apache 2.4.4"

Stop service:

"C:\Apache24\bin\httpd.exe" -k stop -n "Apache 2.4.4"or"C:\Apache24\bin\httpd.exe" -k shutdown -n "Apache 2.4.4"

Restart the service:

"C:\Apache24\bin\httpd.exe" -k restart -n "Apache 2.4.4"

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.