首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 編程語言 >  >> 網頁程式設計 >> PHP 程式設計 >> PHP 相關知識

Windows 環境編譯 PHP 5.4 與 Xdebug 完整實戰紀錄

     編輯:PHP 相關知識

Windows 環境編譯 PHP 5.4 與 Xdebug 完整實戰紀錄

在 Windows 上編譯 PHP 需要 Visual C++ 2008 Express SP1、Windows SDK 6.1、PHP SDK Binary Tools、相依庫與 PHP 原始碼。目標為產出 php_xdebug.dll。

環境準備

  • 建立目錄:D:\php-sdk\php54dev\deps、D:\php-sdk\php54dev\php-5.4.x、D:\php-sdk\pecl\xdebug
  • 解壓 PHP SDK 工具至 D:\php-sdk
  • 解壓 deps-5.4-vc9-x86.7z 至 deps
  • 放入 PHP 原始碼與 Xdebug 原始碼

編譯步驟

  1. 開啟 Windows SDK CMD Shell,執行 setenv /x86 /xp /release
  2. 設定 PATH=D:\php-sdk\bin;%PATH%
  3. 切換至 PHP 原始碼目錄,執行 buildconf 產生 configure.js
  4. 執行 configure 指定選項,例如:
    configure --disable-snapshot-build --disable-debug-pack --disable-ipv6 --disable-zts --disable-isapi --disable-nsapi --without-t1lib --without-mssql --without-pdo-mssql --without-pi3web --without-enchant --enable-com-dotnet --with-mcrypt=static --disable-static-analyze --with-xdebug=shared
  5. 執行 nmake 開始編譯,忽略大量警告訊息
  6. 執行 nmake snap 產生發布套件結構

常見錯誤處理

calendar.c 與 jewish.c 編碼問題(C4819 錯誤):使用 EditPlus 以 Western European (Windows) 編碼開啟,另存為 UTF-8 即可解決。

編譯產出檔案位於 D:\php-sdk\php54dev\php-5.4.x\Release(_TS)。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved