Home  >  Article  >  Backend Development  >  Detailed graphic explanation of the installation and configuration method of apache2.4+php8.0

Detailed graphic explanation of the installation and configuration method of apache2.4+php8.0

藏色散人
藏色散人forward
2022-12-06 16:53:426799browse

This article will introduce to you how to install apache2.4 and how to configure php8.0. The article is accompanied by pictures and detailed steps. Let's take a look at how to install and configure apache2.4 php8.0~

1. Download apache2.4

Detailed graphic explanation of the installation and configuration method of apache2.4+php8.0

2. Unzip and install

Unzip and put it in your favorite location
Open in administrator mode CMD switch directory to the newly decompressed Apache2.4/bin Command line input: http -k install Installation

[Related recommendations: PHP video tutorial]

Detailed graphic explanation of the installation and configuration method of apache2.4+php8.0

3. Configure the apache2.4 directory

Open the file apache2.4/conf/httpd.conf
Change the value of SRVROOT to your own apache2.4 Directory

Detailed graphic explanation of the installation and configuration method of apache2.4+php8.0

4. Start and stop

After the installation is completed, enter net start apache2.4 to start the apache service, net stop apache2.4 to stop the service
Detailed graphic explanation of the installation and configuration method of apache2.4+php8.0

You can also find this by double-clicking to start it

Detailed graphic explanation of the installation and configuration method of apache2.4+php8.0

4. Configure the website root directory

Open the file apache2.4/conf/ httpd.conf
Find DocumentRoot and change it to the root directory of your website
Detailed graphic explanation of the installation and configuration method of apache2.4+php8.0

5. Configure php8.0

at the end of apache2.4/conf/httpd.conf Join

#php8 support
LoadModule php_module “D:/server/software/php/php-8.1.13-Win32-vs16-x64/php8apache2_4.dll”
AddType application/x-httpd-php .php .html .htm
#configure the path to php.ini
PHPIniDir “D:/server/software/php/php-8.1.13-Win32-vs16-x64”

   Header set Access-Control-Allow-Origin: “*”
   Header set Access-Control-Allow-Methods: “GET,POST,PUT,DELETE,OPTIONS”
   Header set Access-Control-Allow-Headers: “Content-Type”

ErrorDocument 404 /index.html

The above is the detailed content of Detailed graphic explanation of the installation and configuration method of apache2.4+php8.0. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete