Instead of patching and rebuilding the whole PHP completely, which is a complicated work, this work implements the API functions that are only available after Vista and then patches the import descriptors of the executable files.
The implemented functions are listed as follows.
DLL file | function name | ver. of nonxp.dll |
iphlpapi.dll | if_nametoindex | 0.0.1.11 |
---|---|---|
kernel32.dll | GetFinalPathNameByHandleA | 0.0.2.20 |
GetFinalPathNameByHandleW | 0.0.2.20 | |
GetTickCount64 | 0.0.1.11 | |
InitializeConditionVariable | 0.0.4.40 | |
InitializeCriticalSectionEx | 0.0.3.30 | |
SleepConditionVariableCS | 0.0.4.40 | |
WakeAllConditionVariable | 0.0.4.40 | |
WakeConditionVariable | 0.0.4.40 | |
shell32.dll | SHGetKnownFolderPath | 0.0.3.30 |
ws2_32.dll | WSASendMsg | 0.0.1.11 |
inet_ntop | 0.0.1.11 | |
inet_pton | 0.0.1.11 |
Copy doiatpatch.bat
, iatpatcher.exe
, and nonxp.dll
to the home directory of PHP and then execute doiatpatch.bat
.
The patched php files can be download in the original page: http://www.lindasc.com/php/
.
The CLI of PHP 7 occurs BUG for unknown reasons; however, its CGI is workable with no BUG.
在使用 composer 安裝 package 時,有可能裝的 package 無法正常執行。例如 nesbot/carbon 中,針對 PHP 5.6 會使用這樣的運算式 1520833979.6569 * 1000000 % 1000000,正常結果應為 656900,但在此版本中,會因溢位得到 -954812 的錯誤結果。