编译configure
configure --disable-all --enable-cli --disable-zts --enable-extname=shared
扩展名叫extname(随便取的),编译出NTS版
编译结果
测试扩展加载
Release下目录的exe可以加载扩展
D:\php_extension\php-sdk-binary-tools-20110915\bin\extname\vc14\x64\php-7.1.10-src\Release>php.exe -m
[PHP Modules]
Core
date
extname
pcre
Reflection
SPL
standard
[Zend Modules]
官网下载的php7.1.10不能加载
C:\Users\salamander>php -v
PHP Warning: PHP Startup: Unable to load dynamic library 'D:/software/SalamanderWnmp/php7.1/ext\php_extname.dll' - %1 不是有效的 Win32 应用程序。
in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'D:/software/SalamanderWnmp/php7.1/ext\php_extname.dll' - %1 不是有效的 Win32 应用程序。
in Unknown on line 0
PHP 7.1.10 (cli) (built: Sep 26 2017 20:03:48) ( NTS MSVC14 (Visual C++ 2015) x64 )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans
问题根源
不是有效的 Win32 应用程序
感觉是这个哦??