欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Windows下編譯PHP5.4和xdebug全記錄

 更新時間:2015年04月03日 09:31:35   投稿:junjie  
這篇文章主要介紹了Windows下編譯PHP5.4和xdebug全記錄,本文講解了編譯環(huán)境以及相關(guān)軟件包、編譯過程、編譯中可能出現(xiàn)的錯誤問題處理等內(nèi)容,需要的朋友可以參考下

實際上我最終目的是編譯得到支持 PHP5.4 的 php_xdebug.dll,而在此之前,成功編譯 PHP5.4 是必須的。

編譯環(huán)境以及相關(guān)軟件包:
1.Microsoft Visual C++ 2008 Express Edition with SP1
2.Windows SDK 6.1
3.PHP SDK Binary Tools
4.Dependable libs
5.PHP5.4 Sources
6.Xdebug 2.2.0-dev
如果你需要的是 VC6 的編譯環(huán)境,那么你需要安裝 Visual C++ 6.0,而 SDK 則需要換成:
Windows Server 2003 PSDK

編譯過程:

準備好咖啡、可樂,做好準備,可能要折騰數(shù)小時…

安裝 VC++ 2008 以及 Windows SDK 6.1

建立如下目錄:

復(fù)制代碼 代碼如下:

D:\php-sdk
D:\php-sdk\php54dev
D:\php-sdk\pecl

解壓 php-sdk-binary-tools-20110915.zip 中的所有文件至 D:\php-sdk
提取 deps-5.4-vc9-x86.7z 中的 deps 目錄至 D:\php-sdk\php54dev
解壓 php5.4 源碼至 D:\php-sdk\php54dev,目錄名任取,比如 php-5.4.0RC3
xdebug 的源碼放到 D:\php-sdk\pecl\xdebug

最終的目錄結(jié)構(gòu)大概是這樣子的:

復(fù)制代碼 代碼如下:

D:\php-sdk>tree D:\php-sdk
Folder PATH listing for volume DISK_VOL2
Volume serial number is 0C74-AD73
D:\PHP-SDK
├───bin
├───php54dev
│   ├───deps
│   │   ├───bin
│   │   ├───include
│   │   ├───lib
│   │   └───sybase
│   ├───pecl
│   │   └───xdebug
│   └───php-5.4.0RC3
├───script
└───share

打開 Windows SDK CMD Shell,執(zhí)行:setenv /x86 /xp /release,如果你是64位系統(tǒng),那么這個命令是必須的,不要試圖把參數(shù)改成 /x64,否則后續(xù)的 make 階段,你會看到成千上萬條 WARNING …

設(shè)定 PATH:set PATH=D:\php-sdk\bin;%PATH%

切換 SHELL 目錄至 D:\php-sdk\php54dev\php-5.4.0RC3>,執(zhí)行 buildconf 生成 configure 腳本:

復(fù)制代碼 代碼如下:

D:\php-sdk\php54dev\php-5.4.0RC3>buildconf
Rebuilding configure.js
Now run 'configure --help'
D:\php-sdk\php54dev\php-5.4.0RC3>

執(zhí)行 configure 生成 Make 腳本,可以查看 configure –help 以獲取更多編譯選項:
復(fù)制代碼 代碼如下:

D:\php-sdk\php54dev\php-5.4.0RC3>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

這里我使用了 –disable-snapshot-build 關(guān)掉了 snapshot 模式,因為這個命令會強制開啟許多對我來說無用的選項,比如 aolserver,apache sapi 之類的,最后我加上了 –with-xdebug=shared,在使用這個選項之前最好確認 xdebug 源碼的位置正確,如果沒什么問題的話,buildconf 之后,在 configure –help 中你可以看到這個選項,shared 表示編譯成動態(tài)鏈接庫。

如果你要編譯其它的 pecl 擴展(比如 apc,bcompiler 等),只需要相關(guān)的源碼下載放到 pecl 目錄,重新執(zhí)行 buildconf 即可。

若 configure 無問題,最后執(zhí)行 nmake 開始編譯過程,Good Luck! :)

最后一步 nmake snap,組織所有編譯好的文件的目錄結(jié)構(gòu)(也就是你平時下載的 PHP 二進制包的結(jié)構(gòu)),并用 zip 打包。

最終生成的文件位置:D:\php-sdk\php54dev\php-5.4.0RC3\Release(_TS)

錯誤處理:
nmake 過程中會產(chǎn)生很多的 Warning,只要不中斷,那么就無視好了。

關(guān)于 calendar.c 和 jewish.c 的編碼問題:

復(fù)制代碼 代碼如下:

ext\calendar\calendar.c : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
dow.c
easter.c
french.c
gregor.c
jewish.c
ext\calendar\jewish.c : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
ext\calendar\jewish.c(324) : error C2001: newline in constant
ext\calendar\jewish.c(325) : error C2001: newline in constant
ext\calendar\jewish.c(326) : error C2001: newline in constant
ext\calendar\jewish.c(327) : error C2001: newline in constant
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\Bin\cl.exe"' : return code '0x2'
Stop.

這兩個文件使用的是 ANSI 編碼,包含有一些西文的特殊字符,GBK 字符集中不存在。
可用 editplus 打開,編碼選擇:West European (Windows),另存為 UTF-8。

相關(guān)文章

最新評論