Windows server2008下基于Apache2.4如何配置php7.2运行环境

发布时间:2021-10-11 11:25:55 作者:柒染
来源:亿速云 阅读:127

Windows server2008下基于Apache2.4如何配置php7.2运行环境,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

安装配置apache2.2

1.下载对应版本的软件

地址:http://httpd.apache.org/

Windows server2008下基于Apache2.4如何配置php7.2运行环境

点击Files for Microsoft Windows链接到windows专属下载页面

Windows server2008下基于Apache2.4如何配置php7.2运行环境

点击ApacheHaus

Windows server2008下基于Apache2.4如何配置php7.2运行环境

点击download完成下载

Windows server2008下基于Apache2.4如何配置php7.2运行环境

2.配置apache

将下载好的apache文件包解压

Windows server2008下基于Apache2.4如何配置php7.2运行环境

将其中的apache24复制到c:\根目录并改名为apache2.4

Windows server2008下基于Apache2.4如何配置php7.2运行环境

打开apache的主配置文件

Windows server2008下基于Apache2.4如何配置php7.2运行环境

将SRVROOT改为我们实际的路径c:\apache2.4, ServerName localhost 保存。

Windows server2008下基于Apache2.4如何配置php7.2运行环境

Windows server2008下基于Apache2.4如何配置php7.2运行环境

3.安装服务

以管理员身份打开命令行模式进入c:\apache2.4\bin目录

Windows server2008下基于Apache2.4如何配置php7.2运行环境

安装httpd服务

Windows server2008下基于Apache2.4如何配置php7.2运行环境

安装完成后,可以双击打开apache的监视器程序(可以启动,停止,重启)

Windows server2008下基于Apache2.4如何配置php7.2运行环境

点击右下角的这个图标选择start启动apache服务

Windows server2008下基于Apache2.4如何配置php7.2运行环境

打开浏览器输入http://localhost 看看以下内容表面 apache 已经再运行了

Windows server2008下基于Apache2.4如何配置php7.2运行环境

安装配置php

1.下载对应版本的php7.2

Windows server2008下基于Apache2.4如何配置php7.2运行环境

Windows server2008下基于Apache2.4如何配置php7.2运行环境

Windows server2008下基于Apache2.4如何配置php7.2运行环境

2.配置php 将下载好的zip文件解压并拷贝到c:\php-7.2

Windows server2008下基于Apache2.4如何配置php7.2运行环境

Windows server2008下基于Apache2.4如何配置php7.2运行环境

进入php-7.2 将php.ini.development改名为php.ini 并在编辑器中打开

Windows server2008下基于Apache2.4如何配置php7.2运行环境

搜索extension_dir 去掉分号,改成 extension_dir = "c:\php-7.2\ext"

Windows server2008下基于Apache2.4如何配置php7.2运行环境

打开常用扩展

Windows server2008下基于Apache2.4如何配置php7.2运行环境

搜索date.timezone去掉分号,改成 date.timezone = Asia/Shanghai

Windows server2008下基于Apache2.4如何配置php7.2运行环境

保存php.ini

再次打开apache 配置文件 httpd.conf 加入以下代码

LoadModule php7_module c:\php7.2\php7apache2_4.dll
PHPIniDir "c:\php-7.2"
AddType application/x-httpd-php .php .html .htm

Windows server2008下基于Apache2.4如何配置php7.2运行环境

使用apache伺服器程序重启apache

在网站根目录下新建 test.php 文件内容如下

<?php

phpinfo();

?>

在浏览器中测试,看到以下信息说明php安装配置成功

Windows server2008下基于Apache2.4如何配置php7.2运行环境

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注亿速云行业资讯频道,感谢您对亿速云的支持。

推荐阅读:
  1. Windows如何安装Apache服务
  2. Windows系统总体架构

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

windows server php apache

上一篇:为何要从PHP转向Go

下一篇:什么是虚拟机栈

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》