Windows installs Apache service and adds PHP parsing

Source: Internet
Author: User

Apache does not provide installation packages for Windows, but they have links to third parties on their official website, and we can find binary packages for Windows on those third-party websites.

We'll go in. Download a 64-bit,

After downloading, we extract the downloaded compressed files to any directory, this machine is as follows:

Then we open the Conf folder under the HTTPD.CONF, modify the following line, the Svroot modified to the above path

Then open the Administrator's Command line window execution, Apache path self-modification:(here to pay attention to command output information, there is a hint error please modify, otherwise the service will not start)

C:\Users\ASUS\Apache24\bin\httpd.exe-k Install "Apache2.4"-F "C:\Users\ASUS\Apache24\conf\httpd.conf"

After executing the above command, we installed the Apache service, next, open the ApacheMonitor.exe in the bin directory.

If the icon in the taskbar is not green, right-click the icon, select Open Services, and then locate Apache2.4, right-click the line, and select Start.

And then it's OK.

In addition, we can set Apachemonitor boot start (self-search)

Add PHP Parsing: Add the following configuration at the top of the httpd.conf file:

AddHandler application/x-httpd-php. Phpaddtype application/x-httpd-php. php. Htmlloadmodule php7_module "C:\Users\ Asus\php-7.1.13\php7apache2_4.dll "Phpinidir" C:\Users\ASUS\php-7.1.13 "

The above C:\Users\ASUS\php-7.1.13 is the PHP installation directory of this machine, please change it yourself

Modify the following lines: entry file add index.php

<ifmodule dir_module>    directoryindex index.php index.html</ifmodule>

Then restart Apache.

Attached: Apache2.4 Example Vhost configuration:

<virtualhost *:80>    ServerAdmin [email protected]    documentroot "C:\Users\ASUS\project\test1"    ServerName test1.local    serveralias test1.local    errorlog "Logs/test1.local-error.log" Customlog "    logs/ Test1.local-access.log "Common    <directory c:\users\asus\project\test1>options Followsymlinksallowoverride Nonerequire All granted</directory></virtualhost>

  

Windows installs Apache service and adds PHP parsing

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.