当前位置:网站首页>Ultra detailed Apache and PHP installation tutorial windows (2022.1)
Ultra detailed Apache and PHP installation tutorial windows (2022.1)
2022-06-23 03:09:00 【Mew】
One 、 preface
The author is at 2022 year 1 Monthly installation Apache and PHP, But because the tutorial found is an old version , There are many problems in the installation process , The author solved the problem one by one , Now I will give you a new tutorial by referring to the previous tutorial and personal experience . edition PHP_8.1.2 and Apache 2.4.52 x64.
Reference resources :
Two 、 Download from the official website
1. Apache download
Download from the official website :Apache Haus Downloads
2. PHP download
Official website :PHP For Windows: Binaries and sources Releases
Pay attention to pay attention to , If you follow my tutorial , Be sure to install the second version , Otherwise, there will be problems in the follow-up .
3、 ... and 、 decompression
It can be changed to a shorter name , For example, I put php-8.1.2-Win32-vs16-x64 Changed to php8.
Four 、 To configure
1. Apache To configure
(1) open httpd.conf, The first 39 That's ok , The original “Apache” Change it to Apache Address .
(2) Test whether the configuration file is legal ( Skippable )
Enter... In the blue position cmd, Open the command line window .
httpd -t# Test whether the configuration file is legal
If you fail , Go back to the previous step , Check whether there is an error when changing the address , For example, I accidentally deleted the quotation marks when copying and pasting , Or forget to save .
(3) install Apache service
httpd -k install -n Apache2.4 #-n Followed by the custom access name
(4) Start the service
① Command start
httpd -k start # start-up httpd -k stop # stop it
If startup fails
First explain why you failed , The default port of the configuration file is 80, And in your computer 80 The port is occupied .
At this time, you need to change a port , such as 81, The operation is as follows :
open httpd.conf,CTRL+F lookup , hold 80 Switch to 81, There will be three .
② Open it manually
(5) test
Routine test methods : Access in browser http://localhost( No port change is successful , Just skip the following .)
But it failed , Why? ?
Because the port is changed , Here, enter in the browser localhost:81.
thus Apache The configuration is successful
2. PHP To configure
(1) open httpd.conf
Copy the following code , green Where you need to change , yes php8 Folder address .
# load PHP LoadModule php_module 'D:\Program Files (x86)\php8\php8apache2_4.dll' # take PHP The configuration file is loaded into the Apache In profile , Take effect together PHPIniDir 'D:\Program Files (x86)\php8' # To configure Apache Assign work to PHP modular , hold PHP Code to PHP Handle # namely .php Suffix file AddType application/x-httpd-php .php
remind : If you install PHP The wrong version was selected when , I can't find it php8apache2_4.dll Of .
(2)php.ini file
Of the above configuration php.ini The file does not exist by default , In order to development and production Format exists , Format processing is required .
Open folder php8
① It's already there ,② it is desirable that .
operation : Copy ① Is a copy , Rename the copy to php.ini, Be careful , Suffix changed .
(3) Test configuration ( Skippable )
Open the service restart Apache
Enter... In the blue position cmd, Open the command line window .
Input instruction
httpd -M
(4) test
stay Apache24\htdocs Create a new Notepad , Name it test.php, The contents are as follows .
<?php //test echo 'hello xx world'; ?>
Type in the browser
localhost/test.php # No port change localhost:81/test.php # If you change the port
End of the flower **,°*:.*( ̄▽ ̄)/$:*.°**
边栏推荐
- Learning record -- superficial understanding of unity decoupling
- Calling applet demo modifying the default large screen view
- The priority supplier field in the purchase information record of SAP mm primary level
- DDoS attack under Kali
- Summary of website navigation design and website link optimization
- Enterprise official website applet building tutorial - solution
- Installing serverstatus probe using pagoda
- DNS Service Setup
- Flowable refactoring process editor to obtain user information
- Transformation solution of digital intelligent supply chain platform for project management in engineering industry
猜你喜欢

Soft exam information system project manager_ Information system comprehensive testing and management - Senior Information System Project Manager of soft test 027

Vulnhub DC-5

5. concept of ruler method

How to store, manage and view family photos in an orderly manner?

8. greed

6. template for integer and real number dichotomy

Soft exam information system project manager_ Contract Law_ Copyright_ Implementation Regulations - Senior Information System Project Manager of soft exam 030
随机推荐
Enterprise official website applet building tutorial - solution
JS how to delete an item specified in an array
Golang string comparison
Extract NTDs with volume shadow copy service dit
Integrate Tencent maps with micro build and low code
Integrated solution for intelligent supply chain platform management in rubber industry
6 values in JS are 'false'
Learning about urldns chains
A bit about the state machine (FSM SMR DFSM)
Use Sakura FRP intranet penetration service to build your own website / game server
Tachometer script
2022 opening H5 mobile page special effects
2022-01-30: minimum good base. For a given integer n, if K (k) of n
Deep analysis of time complexity
Pnas: amygdala individual specific functional connectivity: Fundamentals of precision psychiatry
Establishment of JMeter distributed pressure measurement environment
JS asynchronous mechanism
How to install redis version 5.0.8 on the pagoda panel
Handlebars dynamic adjustment
Reading redis source code (VI) multi threading of redis 6.0