Windows下安装配置PHP

1、 从PHP官网http://www.php.net/下载安装包。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
2、下载后解压到本地更改文件夹名为php。
在这里插入图片描述
3、在Apache的配置文件(conf/httpd.conf)中,添加配置
LoadModule php7_module “D:/Program Files (x86)/php/php7apache2_4.dll”
在这里插入图片描述

4、把PHP的扩展名(.php)和PHP关联起来,在Apache的配置文件(httpd.conf)中搜索AddType,添加配置
AddType application/x-httpd-php .php
在这里插入图片描述
5、配置访问根目录
在这里插入图片描述
6、在根目录添加test.php文件,文件内容为 <?php echo 'Hello World'; ?>
在这里插入图片描述
7、访问http://localhost/test.php,看到Hello World说明安装成功。
在这里插入图片描述