In the apache main configuration file confhttp. conf Add the following encoded: workspace_phpapache-php.conf # file path can be arbitrary under the D: workspace_php file to create a apache-php.conf file its specific content is # PHP-Modulesetup # LoadFileD: xamppphpphp5ts. dllLoadModulephp5_m
In the apache main configuration file/conf/http. conf add Include D: \ workspace_php \ apache-php.conf # file path can be arbitrary in D: \ workspace_php file to create a apache-php.conf file its specific content is # PHP-Module setup # LoadFile D:/xampp/php/php5ts. dllLoadModule php5_m
In the apache main configuration file/conf/http. conf
Add at the bottom
Include "D: \ workspace_php \ apache-php.conf"
# The file path can be any
Create under the D: \ workspace_php File
Apache-php.conf files
Its specific content is
## PHP-Module setup#LoadFile "D:/xampp/php/php5ts.dll"LoadModule php5_module "D:/xampp/php/php5apache2_2.dll"
SetHandler application/x-httpd-php
SetHandler application/x-httpd-php-source
## PHP-CGI setup##
# SetHandler application/x-httpd-php-cgi#
#
# Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"#
PHPINIDir "D:/xampp/php"
AddType text/html .php .phps
ScriptAlias /php-cgi/ "D:/xampp/php/"
AllowOverride None Options None Require all denied
Require all granted
SetHandler cgi-script
SetHandler None
Modify the directory where php is located based on your own situation.
You may have noticed that I am using php under xampp.
This article also draws on the xampp configuration idea, that is, in the apache main configuration file, use the Include command to add custom configuration files,
Minimize the modification to the main configuration file to make the configuration process more modular.