These days have been win8.1 on the configuration of the apache+php environment, read a lot of articles on the Internet, and made a lot of mistakes before the configuration of success, for the novice is really a little difficult.
I'm going to write down the detailed process of the configuration, so that it helps other beginners to quickly configure it.
Here is a reference to the stone-opened blog http://www.cnblogs.com/zhcncn/archive/2013/05/09/3068318.html
Please correct me if the new person posts the wrong place.
1.Apache
Download and install it under the folder with no spaces in the name.
I didn't care at first. Installed under the Program Files folder, Apache also has a folder with a blank name when it is installed by default.
In other words, Apache is in two folders with a space name, which seems to have an impact on PHP. Try not to put it in a folder like this.
Installation of the time of the choice of the address or something I fill out, in the back will be modified.
I downloaded the apache_2.225.msi.
Installed under the D:\Users\JiaGuo\apache directory
Then configure the httdp.conf file under the D:\Users\JiaGuo\apache\Conf folder
1.1. Ctrl+f Search Listen, when found, change 80 to 8080, save
I am afraid Port conflict, 80 port is easy to occupy. Of course, it shouldn't be.
1.2. Search for #Include conf/extra/httpd-vhosts.conf This line, and will # remove, save.
#表示注释, because I am configuring the PC service, so start this so that you can view the Web page with localhost.
1.3. Search to DocumentRoot this line, add later working folder, I set to "e:/php", note to have double quotes, forward slash, save.
Add this folder in order to save PHP files at a later convenience, can also not set. But be aware of user permissions.
If Apache does not have permission to access this folder, the browser will prompt you to log on to this website.
1.4. Search for # This should is changed to whatever you set DocumentRoot to. The line
In Directory this line is changed to a folder with the same name as 3, <directory "e:/php", save and close the file.
This folder has the same name as the 1.3-step folder.
Open the httpd-vhosts.conf file under the D:\Users\JiaGuo\apache\Conf\extra folder
1.5. Search to namevirtualhost *:80 this line, instead namevirtualhost *:8080, save.
This port should be the same as 1.1 steps.
1.6. Change the two <virtualhost> at the end of the file;
<virtualhost *:8080>
ServerAdmin localhost
DocumentRoot "e:/php", this is the working folder set in step 1.3
ServerName localhost
Other lines do not move, save and close the file.
2.Php
I extracted PHP into the D:\Users\JiaGuo\php folder.
2.1. Check this directory to see if you have php5apache2_2.dll this file.
At first I downloaded the php_5.6 inside No, and then downloaded the Php-5.4.0rc4-win32-vc9-x86.zip
There are many versions of this official website, you have to choose the Thread Safe version.
2.2. Change php.ini-development file to php.ini
2.3. Search for Extension_dir This line, change to extension_dir = "D:/users/jiaguo/php/ext" this folder
3.Apache
Go back to the Apche folder and open the httpd.conf file
3.1. Search for #LoadModule vhost_alias_module modules/mod_vhost_alias.so this line
Add two lines
LoadModule php5_module "D:/users/jiaguo/php/php5apache2_2.dll"
Phpinidir "d:/users/jiaguo/php"
3.2. Search for addtype application/x-gzip. GZ tgz This line
Add a row
AddType application/x-httpd-php. php. html
4. Testing
1. Create a new file under the working folder E:\php of the previous step php.info
Enter the following content
<body>
<?php
Phpinfo ();
?>
</body>
Save and close
2. Start the apache2.2 service
Locate apache2.2 in the service options of Task Manager and start
3. Input on IE: localhost:8080/phpinfo.php
If the prompt cannot display this page, there may be 1.2 and 1.6 steps error
If you are prompted to log on to this website, it means that Apache cannot access the working folder you set up, and I set it up in the system disk and need administrator privileges to access it.
Later set in the e:/php under the success.
apache2.2+php5.4 Configuring instances on Windows