Configure php7 and Apache2.4 under Windows

1. First download Apache2.4 and unzip the installation:
use the administrator command to open the cmd command and cd to the Apache bin directory, enter: httpd -k install -n apache2.4
PS: If the installation fails, check whether the port is occupied or not, cmd Command netstat -ano to view the occupied port pid and end the occupied process

Start Apache: cmd command cd to the Apache bin directory and enter: net start
apache2.4
PS: If the startup fails, check if the port 80 has been modified to another port, find the configuration file httpd.conf in the Apache directory, and modify the Listen 80-bit other port

2. Install php7.0 and unzip it

3. Configure Apache
Open the Apache configuration file httpd.conf

Change the directory where Apache is located
Define SRVROOT "F:\lamp\Apache24"

Change the web site root directory
DocumentRoot "${SRVROOT}/htdocs"

Find this line and add it after
PHPIniDir "F:\lamp\php-7.2.0-Win32-VC15-x64"//你的php路径
LoadModule php7_module "F:\lamp\php-7.2.0-Win32-VC15-x64\php7apache2_4.dll"//你的php后面的文件
AddType application/x-httpd-php .php

4. Configure php7.0
Open the configuration file in the PHP7.0 directory, copy php.ini-development as the php.ini file,
find extension_dir, and modify it to extension_dir = “F:\lamp\php-7.2.0-Win32-VC15 -x64\ext"//php extension directory and modified as follows
Open service support

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325749562&siteId=291194637