WordPress遷移Azure之一PHP環境部署

來源:互聯網
上載者:User

標籤:wordpress

原文連結:http://www.jerrysay.com/394.html

今天做為本套課程的第一部分,我們先來帶大家進行本地的PHP環境部署,便於我們進行POC測試以及類比客戶的生產環境。好了不講故事了,我們開始吧。

環境介紹:

1. Microsoft Windows Server 2008 R2

2. IIS

3. php-5.6.4-nts-Win32-VC11-x64

a) :http://windows.php.net/download/

b) 650) this.width=650;" title="clip_image002" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px;" border="0" alt="clip_image002" src="http://s3.51cto.com/wyfs02/M02/58/D7/wKiom1S-DgXDezfKAAA0nxOaZrY897.jpg" height="102" />

c) 為什麼選擇Non Thread Safe,是因為我們採用了IIS並且PHP網站也提供了相關的解釋:

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

4. mysql-5.5.41-winx64

a) :http://dev.mysql.com/downloads/windows/installer/

b) 從官網下載需要使用Oracle帳號

5. VMware Workstation 11

a) 構建PHP POC環境

好了,上述環境介紹完畢,我們Workstation裡面的VM也已經部署完成,在C盤建立PHP檔案夾,並將PHP程式檔案拷貝到此檔案夾中。

650) this.width=650;" title="clip_image004" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px;" border="0" alt="clip_image004" src="http://s3.51cto.com/wyfs02/M02/58/D8/wKiom1S-DgWzSgVVAABN2VGyQcA201.jpg" height="121" />

將PHP檔案夾裡面的php5.dll拷貝到C:\Windows\system32中

將PHP檔案夾裡面的php.ini-development拷貝到案頭進行編寫,在編寫完成後,修改檔案名稱為PHP.ini拷貝到C:\WINDOWS中,下面是php.ini-development需要修改如何內容:

; extension_dir = "./"

;extension=php_mbstring.dll

;extension=php_mysql.dll

;extension=php_mysqli.dll

修改為:

extension_dir = "C:\php\ext"

extension=php_mbstring.dll

extension=php_mysql.dll

extension=php_mysqli.dll

更改預設的IIS配置,添加“處理常式映射”

650) this.width=650;" title="clip_image006" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px;" border="0" alt="clip_image006" src="http://s3.51cto.com/wyfs02/M00/58/D8/wKiom1S-DgXhgI_7AABZdj3s-ho668.jpg" height="198" />

在Default Web Site添加預設文件“index.php”

650) this.width=650;" title="clip_image008" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px;" border="0" alt="clip_image008" src="http://s3.51cto.com/wyfs02/M01/58/D8/wKiom1S-DgahqxR8AAAwie4fEt4684.jpg" height="105" />

在C:\inetpub\wwwroot中建立index.php,並在檔案中編寫下述內容,此檔案用於檢查當前PHP狀態

<?php

Phpinfo();

?>

開啟瀏覽器,訪問http://localhost/index.php,發現有如下報錯

650) this.width=650;" title="clip_image010" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px;" border="0" alt="clip_image010" src="http://s3.51cto.com/wyfs02/M02/58/D4/wKioL1S-DtqgZk3VAAA8mQjldTk224.jpg" height="91" />

究竟問題出現在哪,我們來看一下。

我們在前期準備的時候,缺少了一個軟體“Visual C++ Redistributable for Visual Studio 2012 Update 4”安裝後即可正常訪問phpinfo

650) this.width=650;" title="clip_image012" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px;" border="0" alt="clip_image012" src="http://s3.51cto.com/wyfs02/M00/58/D4/wKioL1S-DtrwZgdVAAA8NTXQC0o076.jpg" height="109" />

本文出自 “用文字記錄生活” 部落格,請務必保留此出處http://jerrysay.blog.51cto.com/2988555/1606191

WordPress遷移Azure之一PHP環境部署

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.