Home  >  Article  >  Backend Development  >  How to install php environment in Win2008 system

How to install php environment in Win2008 system

藏色散人
藏色散人Original
2021-12-15 10:34:392472browse

How to install the PHP environment in Win2008 system: 1. Configure IIS; 2. Create a website; 3. Download the PHP environment installation package and configure the PHP environment; 4. Modify php.ini; 5. Configure iis Just "Process Application Mapping".

How to install php environment in Win2008 system

The operating environment of this article: Windows2008 system, PHP version 5.6.9, Dell G3 computer.

How to install the php environment in Win2008 system?

Win2008 Server configuration PHP environment:

Reading directory

  • Create a website
  • Configuring the PHP environment
  • Configuring the "Processing Application Mapping" of iis

Configure IIS first before configuring the PHP environment.

Portal-> Configuring and installing IIS under Win2008 Server

If IIS is installed with the default configuration, you also need to install CGI.

Check CGI here and install it.

Create a website

Find the manager

Delete the default website.

Create a new website. Right-click the website and select Add Website

Configure the website name as you like, and the physical path is the path where the website is stored

If the server has a bound domain name, set it to the host name configuration.

If not, just leave it blank by default.

Go to the root directory of the website and add an html document at will, and then test it

Configure PHP environment

Download the PHP environment installation package and choose the version you need

http://windows.php.net/downloads/releases/archives/

What I downloaded here is php-5.6.9-nts-Win32-VC11-x86.zip

There are two execution methods of PHP: ISAPI and FastCGI.

nts is Non Thread Safe and is non-threaded Safety, this is based on the FastCGI execution method. It uses a single thread to perform operations, so there is no need to perform thread safety checks.

Removing the protection of thread safety checks can improve execution efficiency, so if FastCGI is used To execute PHP, it is recommended to choose the NonThread Safe version.

On the other hand, if you use ISAPI execution mode, it is recommended to choose the Thread Safe version.

Download and unzip everything to a custom directory

Create a php.ini, php.ini is renamed from php.ini-production

Modify php.ini

Search extension_dir and set the path.

The path inside is the storage path of the php you just decompressed plus ext. Remember it is Backslash, remove the preceding semicolon

Enable components as needed, here are some commonly used ones. Just remove the semicolon to enable it.

If you need anything in the future, just enable it. Of course, if you find it troublesome, just enable it all now.

;extension=php_gd2.dll

;extension=php_curl.dll

;extension=php_mbstring.dll

;extension=php_exif.dll

;extension=php_mysql.dll

;extension=php_mysqli.dll

;extension=php_scokets.dll

;extension=php_pdo_mysql.dll

Search date.timezone to set the time zone to avoid time confusion. Remember to remove the semicolon

. For example: Asia/Chongqing (Chongqing), Asia/Shanghai (Shanghai), Asia/Urumqi (Urumqi), Asia/Macao (Macau), Asia/Hong_Kong (Hong Kong), Asia/Taipei (Taipei), PRC

Set fastcgi.impersonate and cgi.rfc2616_headers

Set cgi.force_redirect = 0 Open Execute PHP in CGI mode

Turn on short tag support,

Configure iis's "Processing Application Mapping"

Add module mapping

Click "Add Module Mapping" on the right to pop up the module mapping settings In the window, enter "*.php" for the name, select "FastCgiModule" for the

module, and select "php-cgi.exe" in the PHP directory you just downloaded and configured to execute the program

Configure default document

Click Add on the right.

Restart IIS.

Add a test document in the root directory of the website and create a new "index.php". The content can be set to

Then test it locally.

PS: The 08 system may lack libraries. Attached is the download address

32-bit Microsoft Visual C Redistributable 2012 download: http://download. microsoft.com/download/9/C/D/9CD480DC-0301-41B0-AAAB-FE9AC1F60237/VSU4/vcredist_x86.exe
64-bit Microsoft Visual C Redistributable 2012 Download: http://download.microsoft.com/download /9/C/D/9CD480DC-0301-41B0-AAAB-FE9AC1F60237/VSU4/vcredist_x64.exe

The above is the detailed content of How to install php environment in Win2008 system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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