Home> php教程> PHP开发> body text

PHP learning apache configuration

黄舟
Release: 2016-12-20 11:56:47
Original
1551 people have browsed it

After talking about the configuration of php, today we will introduce the installation and configuration of apache. I believe that after finishing this lesson, PHP learners will basically be able to install and configure apache by themselves.
1. Apache installation
First download an apache installation package from the Internet. Here we take apache_2.2.6 as an example. Briefly introduce the installation and configuration of apache.
1. Run apache_2.2.6-win32-x86-no_ssl.msi
Network Domain Fill in: Your local domain name can be filled in 127.0.0.1
Server Name Fill in: Server name
Administrator's Email Address Fill in your email
Then click Next to proceed Installation will not be introduced here.
2. After installation, open the httpd.conf file in the conf directory under the installation directory, and add the following three lines at the end:
LoadModule php5_module "c:php/php5apahe2_2.dll"
AddType application/x-http-php. php
PHPIniDir "c:php"
This connects php and apache.
3. The service after apache is installed can be seen in "Start->Programs->Management Tools->Services".
2.apache configuration
1.apache configuration file description
Find httpd.conf in the conf folder of the installation directory. This is the main configuration file of apache.
# is a comment
listen 80 means the listening port is port 80
DocumentRoot “D:/Program Files/Apache Software Foundation/Apaeh2.2/htdocs” Website program root directory
DirectoryIndex index.html Website program default file name
2. Simple Configure apache
Change DocumentRoot "D:/Program Files/Apache Software Foundation/Apaeh2.2/htdocs" to DocumentRoot "e:/source", which means that the root directory of the website program is set to the source folder of the e drive
Also change to

Then, turn on the virtual host - remove the ";" in front of "Include config/extra/http-vhosts.conf" Then, locate DirectoryIndex index.php index.html so that when www.a.com is entered, index will be executed first. php file
Finally add the virtual host, open httpd-vhosts.conf under extra in the configuration file directory, add

ServerAdmin webmaster@dummy-host2.127.0.0.1
DocumentRoot " e:/source/test"
ServerName www.test.com
ErrorLog "logs/dummy-host2.127.0.0.1-error.log"
CustomLog "logs/dummy-host2.127.0.0.1-access.log" common

3. Modify the host file
Find the C:WINDOWSsystem32driversetchosts file
Add a line 127.0.0.1 www.test.com
This will simply configure the apache environment. At this time, PHP learners need to go to e:/ Add a test folder under source and add a web page in it, and that's it.

The above is the content of apache configuration for PHP learning. For more related content, please pay attention to the PHP Chinese website (m.sbmmt.com)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!