Home > Backend Development > PHP Tutorial > Windows Server 2012 Configuration Guide - PHP Environment Setup

Windows Server 2012 Configuration Guide - PHP Environment Setup

黄舟
Release: 2023-03-05 22:50:02
Original
8553 people have browsed it

php 5.6.12
Download address: http://www.php.cn/
Visual Studio 2010 dynamic link library (64-bit systems must install both, if not installed it will There is a problem of msvcr100.dll missing, resulting in 500 error)
Download address: http://www.php.cn/
Download address: http://www.php.cn/
First of all , download and install Visual Studio 2010 dynamic link library
Windows Server 2012 Configuration Guide - PHP Environment Setup

2015-8-11 23:17 Upload

Download attachment

Windows Server 2012 Configuration Guide - PHP Environment Setup

2015-8-11 23:17 Upload

Download attachment

Create the "php" folder in the root directory of drive C
Windows Server 2012 Configuration Guide - PHP Environment Setup

2015-8-11 23:17 Upload

Download attachment

Copy all downloaded php files to " php" folder
Windows Server 2012 Configuration Guide - PHP Environment Setup

2015-8-11 23:17 Upload

Download attachment

Copy "php. ini-production" and renamed it to "php.ini"
Windows Server 2012 Configuration Guide - PHP Environment Setup

##2015-8-11 23:18 Upload

Download attachment

Open "php.ini" with Notepad and set the php module path

extension_dir = "C:\php\ext"

Windows Server 2012 Configuration Guide - PHP Environment Setup##2015-8-11 23:18 Upload

Download attachment

Set php time zone

date.timezone = Asia/Shanghai



Windows Server 2012 Configuration Guide - PHP Environment Setup2015-8- 11 23:18 Upload

Download attachment

Open php short tag

short_open_tag = on

Windows Server 2012 Configuration Guide - PHP Environment Setup2015-8-11 23:18 Upload

Download attachment

Run PHP in CGI mode

cgi.force_redirect = 0



Windows Server 2012 Configuration Guide - PHP Environment Setup2015-8-11 23:18 Upload

Download attachment

fastcgi.impersonate = 1

Windows Server 2012 Configuration Guide - PHP Environment Setup2015-8-11 23:18 Upload

Download attachment

cgi.rfc2616_headers = 1


Windows Server 2012 Configuration Guide - PHP Environment Setup2015-8-11 23:18 Upload

Download attachment

PHP expansion section,

Open on demand


1Windows Server 2012 Configuration Guide - PHP Environment Setup2015-8-11 23:18 Upload

Download attachment

Enter the IIS control panel and select the home page, click "Handler Mapping"


1Windows Server 2012 Configuration Guide - PHP Environment Setup2015-8-11 23:18 Upload

Download Attachment

Click "Add Module Mapping"


1Windows Server 2012 Configuration Guide - PHP Environment Setup2015-8-11 23:18 Upload

Download attachment

Click "OK" after entering the content
Request path: *.php
Module: FastCgiModule
Executable file (optional) ): C:\php\php-cgi.exe
Name: FastCgi
not foundFastCgiModule The solution to the module is at the end of the post Below
1Windows Server 2012 Configuration Guide - PHP Environment Setup

2015-8-11 23:18 Upload

Download attachment

Click "Yes"
1Windows Server 2012 Configuration Guide - PHP Environment Setup

2015-8-11 23:18 Upload

Download attachment

Click "FastCGI Settings"
1Windows Server 2012 Configuration Guide - PHP Environment Setup

2015-8-11 23:18 Upload

Download Attachment

Right click and click "Edit"
1Windows Server 2012 Configuration Guide - PHP Environment Setup

2015-8-11 23:19 Upload

Download Attachment

Replace "Monitor changes made to the file "Change to the absolute location of php.ini C:\php\php.ini
1Windows Server 2012 Configuration Guide - PHP Environment Setup

##2015-8-11 23:19 Upload

Download Attachment

Click the button on the right side of "Aggregation Editor"


1Windows Server 2012 Configuration Guide - PHP Environment Setup

2015-8-11 23:19 Upload

Download attachment

Add information and click "OK"


Name: PHP_FCGI_MAX_REQUESTS

Value: 1000

1Windows Server 2012 Configuration Guide - PHP Environment Setup

2015-8-11 23:19 Upload

Download attachment

In the IIS control panel, Click "Default Document"


2Windows Server 2012 Configuration Guide - PHP Environment Setup

2015-8-11 23:19 Upload

Download attachment

Add "index .php”


2Windows Server 2012 Configuration Guide - PHP Environment Setup

2015-8-11 23:19 Upload

Download attachment

Create under the default site A file named "index.php"


2Windows Server 2012 Configuration Guide - PHP Environment Setup

2015-8-11 23:19 Upload

Download attachment

Edit "index.php", test PHP information, save and exit



phpinfo();
?>
2Windows Server 2012 Configuration Guide - PHP Environment Setup

2015-8-11 23:19 Upload

Download attachment

Visit http://www. php.cn/ Successfully configured PHP


2Windows Server 2012 Configuration Guide - PHP Environment Setup

2015-8-11 23:19 Upload

Download attachment

Note: Some friends may not be able to find the "FastCgiModule" section. That is because CGI is not installed. You only need to select CGI in the "Add Roles and Functions Wizard" and install it
11Windows Server 2012 Configuration Guide - PHP Environment Setup

The above is the content of the Windows Server 2012 Configuration Guide - PHP Environment Setup. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template