PHP7在windows环境中安装已经不像低版本的php了它需要安装其它的一些插件才可以正常的运行了,下面我们来看一篇关于Windows服务器安装配置PHP7.0环境图文教程了,希望对各位有帮助。

在Windows环境下载及配置PHP7.0,2015年9月可下载PHP5.4至7.0,这次使用最新PHP版本7.0。而「PHP 7.0.0 RC 1」、「PHP 7.0.0 RC 2」是属于开发当中的版本,在生产环境使用需注意,稳定版是PHP5.6.13。

确认Microsoft Visual C++版本

Microsoft Visual C++的版本至关重要,根据Microsoft Visual C++版本下载的PHP不同。

PHP官网的左侧栏有以下注释。

VC9, VC11 & VC14

More recent versions of PHP are built with VC9, VC11 or VC14 (Visual Studio 2008, 2012 or 2015 compiler respectively) and include improvements in performance and stability.

– The VC9 builds require you to have the Visual C++ Redistributable for Visual Studio 2008 SP1 x86 or x64 installed

– The VC11 builds require to have the Visual C++ Redistributable for Visual Studio 2012 x86 or x64 installed

– The VC14 builds require to have the Visual C++ Redistributable for Visual Studio 2015 x86 or x64 installed

根据Microsoft Visual C++版本选择下载的PHP版本。

VC9:Microsoft Visual C++ 2008

VC11:Microsoft Visual C++ 2012

VC14:Microsoft Visual C++ 2015

点击「开始」->「控制面板」>->「卸载程序」,可以查看到现在的Microsoft Visual C++的版本。

Microsoft Visual C++版本是2015,因此必须选择VC14开始的PHP文件。

下载PHP7.0

从以下PHP官网进行下载。

http://www.php.net/

「PHP 7.0.0 RC 2」处写着「Windows source and binaries can be found on windows.php.net/qa/」。

下载源码访问如下URL。

http://windows.php.net/qa/

PHP7.0(7.0.0RC2)的32位有「VC14 x86 Non Thread Safe」、「VC14 x86 Thread Safe」,64位有「VC14 x64 Non Thread Safe」、「VC14 x64 Thread Safe」。这次使用环境是Windows Server2008 64位因此选择下载64位的「VC14 x64 Thread Safe」,大家根据自己的实际环境选择下载的源文件(下载之前再次提醒大家注意VC9、VC11、VC14是根据Windows环境的Microsoft Visual C++版本选择,如果Microsoft Visual C++ 2012的话,就不可以下载VC14的PHP文件。)。

重要的是在左侧栏,有以下注意事项。

IIS

If you are using PHP as FastCGI with IIS you should use the Non-Thread Safe (NTS) versions of PHP.

Apache

Please use the Apache builds provided by Apache Lounge. They provide VC9, VC11 and VC14 builds of Apache for x86 and x64. We use their binaries to build the Apache SAPIs.

If you are using PHP as module with Apache builds from apache.org (not recommended) you need to use the older VC6 versions of PHP compiled with the legacy Visual Studio 6 compiler. Do NOT use VC9+ versions of PHP with the apache.org binaries.

With Apache you have to use the Thread Safe (TS) versions of PHP.

这次是在以Apache为Web服务器的环境下使用PHP。Apache可在Apache Lounge进行下载(具体的下载方法参照下载Apache2.4.16,安装方法参照安装Apache2.4.16)。

PHP有「Non Thread Safe」、「Thread Safe」版本,在这里使用「Thread Safe」版本。

点击「VC14 x64 Thread Safe (2015-Sep-04 02:40:39)」的Zip。

点击「保存」下载到任意的目录下,就完成PHP的下载步骤了。

安装PHP7.0

接着来进行PHP的安装步骤。把下载的文件解压以后,存放到任意的目录下就完成安装了。这次安装到「C:\MiddleWare\PHP」。

运行PHP所需的所有文件都在该目录下。

1) 添加PHP模块

首先确认PHP模块的路径。

在「httpd.conf」文件,寻找「Dynamic Shared Object (DSO) Support」的部分。默认是在61行附近。

并在最后追加如下一行。

LoadModule php7_module C:/MiddleWare/PHP/php7apache2_4.dll

# Dynamic Shared Object (DSO) Support

#

# To be able to use the functionality of a module which was built as a DSO you

# have to place corresponding `LoadModule' lines at this location so the

# directives contained in it are actually available _before_ they are used.

# Statically compiled modules (those listed by `httpd -l') do not need

# to be loaded here.

#

# Example:

# LoadModule foo_module modules/mod_foo.so

#

LoadModule access_compat_module modules/mod_access_compat.so

LoadModule actions_module modules/mod_actions.so

・・・

・・・

#LoadModule xml2enc_module modules/mod_xml2enc.so

LoadModule php7_module C:/MiddleWare/PHP/php7apache2_4.dll

追加以上配置以后Apache启动时,会读取PHP模块。

2) 登录扩展名

把PHP的扩展名(.php)和PHP关联起来。例如访问「http://www.example.com/sample.php」时,返回给浏览器的不是sample.php的内容,而是sample.php记载的PHP脚本的执行结果。

在「httpd.conf」文件里搜索「AddType」。默认是在404行附近,并追加如下2行。

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

#

# TypesConfig points to the file containing the list of mappings from

# filename extension to MIME-type.

#

TypesConfig conf/mime.types

#

# AddType allows you to add to or override the MIME configuration

# file specified in TypesConfig for specific file types.

#

#AddType application/x-gzip .tgz

#

# AddEncoding allows you to have certain browsers uncompress

# information on the fly. Note: Not all browsers support this.

#

#AddEncoding x-compress .Z

#AddEncoding x-gzip .gz .tgz

#

# If the AddEncoding directives above are commented-out, then you

# probably should define those extensions to indicate media types:

#

AddType application/x-compress .Z

AddType application/x-gzip .gz .tgz

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

・・・

・・・

追加以上2行之后当访问扩展名为.php文件时,PHP程序会进行处理。

3) 指定php.ini配置文件路径(PHPIniDir)

首先确认存放php.ini文件目录。

在「httpd.conf」文件里指定PHP配置文件php.ini的目录,在这里添加到「httpd.conf」文件的最后。

PHPIniDir “c:/MiddleWare/PHP”

Apache会参照PHPIniDir目录下的php.ini文件。

4) 确认PHP运行情况

PHP相关的Apache配置已经完成。在这里作一个简单的PHP脚本文件确认配置是否正确。变更配置文件之后别忘了重启Apache。

打开文本编辑器,追加如下内容。

phpinfo();

?>

文静名为「phpinfo.php」,保存到Apache的htdocs目录下。

打开浏览器输入「http://localhost/phpinfo.php」。如以下页面显示PHP相关信息的话,Apache可以正常调用PHP了。

好了以上就是关于Windows服务器安装配置PHP7.0环境图文教程了,这里介绍了安装那个版本的插件可以支持php 7正常在windows中运行了。

php7.0康乐安装_Windows服务器安装配置PHP7.0环境图文教程相关推荐

  1. [转]Aptana Studio 3配置Python开发环境图文教程

    转载URL:http://www.cr173.com/html/49260_1.html 一.安装Aptana Studio 3 安装完运行时建议将相关默认工作目录设定在英文的某个目录下.避免可能出现 ...

  2. VUE3.0 一.安装node.js、vue3.0脚手架

    VUE3.0 一.安装node.js.vue3.0脚手架 1.安装nodejs 首先去官网下载nodejs 查看npm和node版本,出现版本号即安装成功. npm -v # 6.13.4node - ...

  3. TURBOLinux 7.0下安装Oracle 8.1.7.0.1 release 3

    作者:shiley 时间:2002-5-20 ----------------------------------------------------------------------------- ...

  4. 安装JDK以及配置Java运行环境

    安装JDK以及配置Java运行环境 1.JDK下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2 ...

  5. Win7、windows 2008 IIS7.5下载安装方法以及教程 IIS7配置PHP环境图文教程(fastcgi快速最新版)

    Win7 IIS7.5下载安装方法以及教程 win7iis安装包下载: win7 IIS7.5 Express 多国语言官方中文安装版下载 第一步,进入控制面板,点击程序图标 第二步,点击打开或关闭W ...

  6. asp.Net Core免费开源分布式异常日志收集框架Exceptionless安装配置以及简单使用图文教程...

    最近在学习张善友老师的NanoFabric 框架的时了解到Exceptionless : https://exceptionless.com/ !因此学习了一下这个开源框架!下面对Exceptionl ...

  7. iis 7 安装php环境_iis7配置php环境图文教程

    原标题:iis7配置php环境图文教程 网站采用PHP编写,但是,其服务器环境可不一定是FreeBSD.Linux,很多PHP的网站都是运行在Windows2000.Windows2003和Windo ...

  8. Spring Boot 2.0 的配置详解(图文教程)

    本文来自作者 泥瓦匠 @ bysocket.com 在 GitChat 上分享 「Spring Boot 2.0 的配置详解(图文教程)」 编辑 | 哈比 Spring Boot 配置,包括自动配置和 ...

  9. linux怎么配置日志,Linux配置日志服务器的图文教程

    Linux配置日志服务器的图文教程 前言 本文主要介绍的是关于Linux配置日志服务器的相关内容,分享出来供大家参考学习,下面话不多说了,来一起看看详细的介绍吧 日志服务器配置文件:/etc/rsys ...

最新文章

  1. android 中测量高度和宽度,android获得屏幕高度和宽度(display中getSize(Point)方法使用)...
  2. Fail to connect to camera service的几种原因和解决方法
  3. 发送WM_COPYDATA消息实现进程间的通信
  4. Sentinel集群流控
  5. NLP之路-Deep Learning for NLP 文章列举
  6. Java如何获得系统时间
  7. 线程相关的sleep()、yield()、wait()、join()方法介绍
  8. python 高中信息技术 会考_2019信息技术会考真题
  9. amd显卡用黑苹果输出黑屏_黑苹果XFX讯景显卡刷vBIOS教程,使其黑苹果显卡更稳定完美,不再黑屏...
  10. VOC数据集格式介绍
  11. 儿童摄影HTML实现
  12. android手机如何截屏,安卓手机怎么截屏(华为手机的几种截图方法)
  13. 描写计算机硬件的英语作文,介绍关于电脑的英语作文
  14. 如何在五分钟让你的应用拥有高精度定位功能
  15. 查询学生的学号、课程号和成绩,并按成绩升序排序
  16. 聊一次跳槽被怼的经历
  17. 一道简单的电商数据分析笔试题:求组合商品的库存量
  18. HIP4082电机驱动电路详解
  19. 编译器之语法分析器(syntax analyzer)
  20. 开放平台API接口加密,签名策略

热门文章

  1. 2018 开始认真学习点python
  2. 移动办公之路的行业探索
  3. Eclipse·Maven·构建SpringMVC简单工程-3
  4. Reactjs不能忽略的key
  5. [MVC4]初识.NET MVC4
  6. oracle表中一个字段内容导出到磁盘上
  7. Atlassian 修复严重的 Jira 认证绕过漏洞
  8. 奇安信代码安全实验室帮助微软修复高危漏洞,获官方致谢
  9. 2019最有意思的五大 ZDI 案例之:通过调色板索引实现 Win32k.sys 本地提权漏洞 (下)...
  10. 【Spring Boot】28.开发热部署