Windows Manually build PHP Runtime environment

Source: Internet
Author: User

First, you can create a wamp directory inside the directory, my creation on the E: disk

1.0 download apache2.4,x64 bits, VC11 components [How many bits of the computer are loaded]

apache: VC component can be selected on the left side of the site, then the corresponding version)
VC11 (required):'t ask why vc2012)
After download, open the compressed package, directly drag the Apache24 folder to the Wamp directory, and renamed Apache, the following folders first forget, a department to

1.1 Configure Apache (Note #)   

Open E:\wamp\apache\conf\httpd.conf (recommended to open with editor, recommended Sublime)

① Modify the 37th line ServerRoot "E:/wamp/apache" to the address you installed Apache

② the 58th line refers to the Apache port number, the default 80 port, you can not change.

③ No. 210 Line ServerAdmin [email protected]

Refers to the administrator mailbox, the local environment to ignore, if it is a website, will be processing some PHP programs need to receive the mail.

④ Line No. 219 #ServerName

Refers to the service name, website domain name, the following refers to the port number, the local environment is not modified.

For example, Blog Park, to open this line, remove the # number, modified to ServerName

⑤ No. 243 244 line,
Apache to parse the directory of PHP files, it is the default in E:\wamp\apache\htdocs This folder, we can customize the changes, in order to store open files are convenient. Create a WWW directory under the e: disk to put PHP files and projects and so on.
Modified 243,244 to
DocumentRoot "E:/wamp/www"
<directory "E:/wamp/www" >

⑥ Line No. 277
Apache parsing php Default open files, you can add it yourself. I'm just going to add index.php to the back,
Modified: DirectoryIndex index.html index.php

⑦ Line No. 360
Modified to: scriptalias/cgi-bin/"e:/wamp/apache/cgi-bin/"
Your Apache directory for cgi-bin files, this file is Apache needs to execute the program

⑧ Line No. 376
Modify the path as above. Modified to: <directory "e:/wamp/apache/cgi-bin/" >

⑨ Open allowoverride
Press Ctrl+f to find allowoverride to change the bit all after the none.

⑩ This httpd.conf is configured, Run command cmd as an administrator to prevent the failure of permissions from running.
Add service to boot from PC:

See below:

Installing the ' Apache2.4 ' service
The ' Apache2.4 ' service is successfully installed.

So the installation was successful,

1  if(with an error) {2 indicates the httpd you configured.  3 }else{4  VC component installed       5 }

OK, now Configure PHP

2.0 installing PHP

php5.5 Download Link: -5.5
Recommended V11 x64, which is 64-bit.

Download Security Thread Edition

Create a PHP directory just as you would create a directory with Apache. And put the extracted files into the PHP directory,

Copy the php.ini-deveplopment into the directory and rename it to PHP.ini

Open php.ini with Sublime

2.1 Configure PHP.ini   
① the No. 735 line, remove the semicolon revision to
Extension_dir = "E:/wamp/php/ext" (Note your PHP path error)

② 第877-912 PHP extension components, can be opened according to the expansion of their own needs. I'll open it all here and remove the semicolon from the front;

③ the No. 925 line is amended to read
Date.timezone = PRC Remove the preceding semicolon. PRC refers to China time zone.

Ok. PHP is configured in these three places, is not very quick and easy.

If it is a server, you can disable the function, you can add yourself for example

Disable_functions = Passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open ...

One final step:
Open the htpdd.conf at the end of Apache to add the following lines. Used to get Apache to parse PHP:

1 # PHP installation directory 2 # Apache parsing php dll files 3 # Apache parsing php suffix 4 # Apache parsing PHP Source: The basic meaning is ibid.

OK, end. Restart the Aapche service.

(If the Apache reboot fails.) See if the php.ini is misconfigured, and look at the number of lines added at the end of the path there is no fault)

Create a new index.php content in the WWW directory as:

1 <? PHP 2 Phpinfo (); 3 ?>

Open browser input localhost, see the following to indicate that the installation was successful. Can be pulled down to see the open PHP extension

In this way, MySQL installed to the official website to download an MSI installation package to modify the next path, a fool installation, "set" away

Windows Manually build PHP Runtime environment

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