Windows服务器安装配置PHP7.0环境图文教程
摘自http://www.111cn.net/phper/linux-php/109865.htm
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++的版本。

下载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/」。

- 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文件。)。
重要的是在左侧栏,有以下注意事项。
If you are using PHP as FastCGI with IIS you should use the Non-Thread Safe (NTS) versions of PHP.
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.
点击「VC14 x64 Thread Safe (2015-Sep-04 02:40:39)」的Zip。

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

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

运行PHP所需的所有文件都在该目录下。
1) 添加PHP模块
首先确认PHP模块的路径。

# 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
2) 登录扩展名
把PHP的扩展名(.php)和PHP关联起来。例如访问「http://www.example.com/sample.php」时,返回给浏览器的不是sample.php的内容,而是sample.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
・・・
・・・
</IfModule>
3) 指定php.ini配置文件路径(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中运行了。
Windows服务器安装配置PHP7.0环境图文教程的更多相关文章
- (超简单)VScode配置C/C++环境图文教程(Windows系统下)
(超简单)VScode配置C/C++环境图文教程(Windows系统下) 本文参考文章 Visual Studio Code (vscode) 配置 C / C++ 环境 下载VScode.下载Min ...
- [转]Aptana Studio 3配置Python开发环境图文教程
转载URL:http://www.cr173.com/html/49260_1.html 一.安装Aptana Studio 3 安装完运行时建议将相关默认工作目录设定在英文的某个目录下.避免可能出现 ...
- eclipse配置spring4.0环境详细教程
最近几天学习spring框架,在环境搭建过程中遇到了不少问题,网上找了不少资料都不是特别好,所以自己重新记录一下. 准备: 1.Eclipse下载,进官网,这里直接给链接了https://www.ec ...
- C#实现多级子目录Zip压缩解压实例 NET4.6下的UTC时间转换 [译]ASP.NET Core Web API 中使用Oracle数据库和Dapper看这篇就够了 asp.Net Core免费开源分布式异常日志收集框架Exceptionless安装配置以及简单使用图文教程 asp.net core异步进行新增操作并且需要判断某些字段是否重复的三种解决方案 .NET Core开发日志
C#实现多级子目录Zip压缩解压实例 参考 https://blog.csdn.net/lki_suidongdong/article/details/20942977 重点: 实现多级子目录的压缩, ...
- asp.Net Core免费开源分布式异常日志收集框架Exceptionless安装配置以及简单使用图文教程
最近在学习张善友老师的NanoFabric 框架的时了解到Exceptionless : https://exceptionless.com/ !因此学习了一下这个开源框架!下面对Exceptionl ...
- Windows2016的 IIS中配置PHP7运行环境
Windows2016的 IIS中配置PHP7运行环境 在Windows 的IIS(8.0)中搭建PHP运行环境: 一:安装IIS服务器 .进入控制面板>>程序和功能>>打开或 ...
- 【转】asp.Net Core免费开源分布式异常日志收集框架Exceptionless安装配置以及简单使用图文教程
最近在学习张善友老师的NanoFabric 框架的时了解到Exceptionless : https://exceptionless.com/ !因此学习了一下这个开源框架!下面对Exceptionl ...
- kubernetes(K8S)快速安装与配置集群搭建图文教程
kubernetes(K8S)快速安装与配置集群搭建图文教程 作者: admin 分类: K8S 发布时间: 2018-09-16 12:20 Kubernetes是什么? 首先,它是一个全新的基于容 ...
- windows下vue.js开发环境搭建教程
这篇文章主要为大家详细介绍了windows下vue.js开发环境搭建教程,具有一定的参考价值,感兴趣的小伙伴们可以参考一下 最近,vue.js越来越火.在这样的大浪潮下,我也开始进入vue的学习行列中 ...
随机推荐
- Apache伪静态在网站目录没有反斜杠后自动添加反斜杠
第一步:确认网站开启REWRITE规则 一般有两种情况: i.apache安装的时候已经包含rewrite功能 ii.后续配置的时候新添加mod_rewrite.so.这种情况需要在httpd.con ...
- 【python】迭代器&生成器
源Link:http://www.cnblogs.com/huxi/archive/2011/07/01/2095931.html 迭代器 迭代器是访问集合元素的一种方式.迭代器对象从集合的第一个元素 ...
- 驱动开发学习笔记. 0.05 linux 2.6 platform device register 平台设备注册 2/2 共2篇
驱动开发读书笔记. 0.05 linux 2.6 platform device register 平台设备注册 2/2 共2篇 下面这段摘自 linux源码里面的文档 : 内核版本2.6.22Doc ...
- ConfigHelper.cs
using System.Configuration; using System.IO; /// <summary> /// 配置文件辅助类 /// </summary> pu ...
- Linux cp命令使用说明
Linux cp命令使用说明 --功能说明:复制目录或文件 --命令格式:cp [参数] <文件或目录> <文件或目录> --常用参数: -R 复制目录 -i 覆盖文件之 ...
- Visual Studio 实现 编写一套.net代码,同时编译到 多个平台,多版本的操作笔记
如题,把一套代码.NET代码.编译成多平台,多版本dll文件. 项目结构如图(Cvs文件读写开源组件 https://github.com/JoshClose/CsvHelper) 如上图.项目工程 ...
- Java中四种引用:强、软、弱、虚引用
这篇文章非常棒:http://alinazh.blog.51cto.com/5459270/1276173 Java中四种引用:强.软.弱.虚引用 1.1.强引用当我们使用new 这个关键字创建对象时 ...
- 20151208Study
20151208-----------------------------------------------------* Her main interest now is raising her ...
- (待续)C#语言中的动态数组(ArrayList)模拟常用页面置换算法(FIFO、LRU、Optimal)
目录 00 简介 01 算法概述 02 公用方法与变量解释 03 先进先出置换算法(FIFO) 04 最近最久未使用(LRU)算法 05 最佳置换算法(OPT) 00 简介 页面置换算法主要是记录内存 ...
- Hibernate配置与事务管理
数据库中 @num:代表一个变量 Set @num = 10; Select @num+@num from dual; dual:临时表 得到结果 20 Hibernate:运用数据持久化,使用OR ...