Windows Server 2016 配置指南 之 PHP7 環境搭建篇

來源:互聯網
上載者:User
因為 PHP7 在 Windows 已經提供了完整的 64bit 支援,所以選擇 64bit 系統安裝 64bit PHP7 將獲得更好的效能表現。

PHP7 需要 VC14 ( Visual C++ Redistributable for Visual Studio 2015 x86 or x64)做運行庫,所以我們先要安裝 VC14。

一、下載並安裝運行庫:x64 安裝 64 位元的運行庫,x86 安裝 32位的運行庫。

32位下載: https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x86.exe

64位下載: https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe

二、下載 PHP7

這裡列出的是無安全線程的 PHP 7.0.3,其他版本大家可以到: PHP For Windows 尋找。

32位下載: http://windows.php.net/downloads/releases/php-7.0.3-nts-Win32-VC14-x86.zip

64位下載: http://windows.php.net/downloads/releases/php-7.0.3-nts-Win32-VC14-x64.zip

三、解壓並設定 PHP7

1. 在 C盤 建立 php 目錄。

  1. 將下載的 PHP 檔案解壓到 C:\php

  2. 讓 Windows 顯示檔案尾碼等, 點擊 查看 —— 點勾如所示兩項目

  3. 複製 php.ini-production 並改名為 php.ini

5.修改 PHP.ini 參數,用 記事本 開啟並修改(遇到 ; 將其刪掉便是啟用!):

①設定php模組路徑

extension_dir = "C:\php\ext"

②設定php時區

date.timezone = Asia/Shanghai

③開啟php短標籤

short_open_tag 下的 `;` 全都刪掉

④以fast—CGI模式運行PHP

cgi.force_redirect = 0

fastcgi.impersonate = 1

[1] [2] 下一頁

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.