配置apache以支持php 在apache主配置文件httpd.conf中Include自
在apache的主配置文件/conf/http.conf 最下面添加 Include D:\workspace_php\apache-php.conf #文件路径可以任意 在D:\workspace_php文件下创建 apache-php.conf文件 它的具体内容为 ## PHP-Module setup#LoadFile D:/xampp/php/php5ts.dllLoadModule php5_m
在apache的主配置文件/conf/http.conf
最下面添加
Include "D:\workspace_php\apache-php.conf"
#文件路径可以任意
在D:\workspace_php文件下创建
apache-php.conf文件
它的具体内容为
# # PHP-Module setup # LoadFile "D:/xampp/php/php5ts.dll" LoadModule php5_module "D:/xampp/php/php5apache2_2.dll" <filesmatch> SetHandler application/x-httpd-php </filesmatch> <filesmatch> SetHandler application/x-httpd-php-source </filesmatch> # # PHP-CGI setup # #<filesmatch> # SetHandler application/x-httpd-php-cgi #</filesmatch> #<ifmodule actions_module> # Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe" #</ifmodule> <ifmodule php5_module> PHPINIDir "D:/xampp/php" </ifmodule> <ifmodule mime_module> AddType text/html .php .phps </ifmodule> ScriptAlias /php-cgi/ "D:/xampp/php/" <directory> AllowOverride None Options None Require all denied <files> Require all granted </files> </directory> <directory> <filesmatch> SetHandler cgi-script </filesmatch> <filesmatch> SetHandler None </filesmatch> </directory>
其中php所在的目录请根据自己的情况进行修改。
你可能已经注意到我用的是xampp下php。
本文也是借鉴了xampp的配置思路,即在apache主配置文件中多使用Include指令来添加自定义的配置文件,
尽可能减少对主配置文件的修改,使配置过程更加模块化。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

Dreamweaver CS6
Visual web development tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft