Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Error when I run nmake to build php-src along with grpc php extension

54 views
Skip to first unread message

aravind jayanthi

unread,
Jan 17, 2025, 4:27:56 PMJan 17
to grpc.io
Hello Team,

I am trying to compile and built php-src code on Windows docker image along with some php extensions to build a consistent image for my pipeline. When I am trying to build the grpc extension along with the php-src code, I am getting the following error:
 
C:\php-sdk\phpdev\vs17\x64\php-8.4.2-src\Zend\zend_config.w32.h(34): warning C4005: 'WIN32_LEAN_AND_MEAN': macro redefinition
C:\php-sdk\phpdev\vs17\x64\php-8.4.2-src\Zend\zend_config.w32.h(34): note: 'WIN32_LEAN_AND_MEAN' previously declared on the command line
C:\php-sdk\phpdev\vs17\x64\php-8.4.2-src\ext\random\php_random_uint128.h(84): warning C4146: unary minus operator applied to unsigned type, result still unsigned
main\internal_functions.c(71): error C2065: 'phpext_grpc_ptr': undeclared identifier
main\internal_functions.c(65): error C2099: initializer is not a constant
NMAKE : fatal error U1077: '"cl.exe" /D _USRDLL /D PHP_EXPORTS /D LIBZEND_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=0x0602 /D COMPILE_DL_GD /D COMPILE_DL_OPENSSL /D COMPILE_DL_FILEINFO /D COMPILE_DL_INTL /D COMPILE_DL_MONGODB /D COMPILE_DL_ZIP  /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1  /I "..\deps\include" /DHAVE_CURL_EASY_H=1 /DHAVE_OPENSSL_SSL_H=1 /D CURL_STATICLIB /D PHP_CURL_EXPORTS=1 /Iext/date/lib /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /DHAVE_TIMELIB_CONFIG_H=1 /wd4244 /DOPENSSL_NO_ASM /D_GNU_SOURCE /DWIN32_LEAN_AND_MEAN /D_HAS_EXCEPTIONS=0 /DNOMINMAX /DGRPC_ARES=0 /D_WIN32_WINNT=0x600 /Iext\grpc /Iext\grpc\include /Iext\grpc\src\core\ext\upb-gen /Iext\grpc\src\core\ext\upbdefs-gen /Iext\grpc\src\php\ext\grpc /Iext\grpc\third_party\abseil-cpp /Iext\grpc\third_party\address_sorting\include /Iext\grpc\third_party\boringssl-with-bazel\src\include /Iext\grpc\third_party\re2 /Iext\grpc\third_party\upb /Iext\grpc\third_party\utf8_range /Iext\grpc\third_party\xxhash /Iext\grpc\third_party\zlib /I "ext/hash/sha3/generic64lc" /DHAVE_KECCAKHASH_H=1 /DKeccakP200_excluded /DKeccakP400_excluded /DKeccakP800_excluded /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /I "..\deps\include" /DHAVE_ICONV_H=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /D PHP_ICONV_EXPORTS /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /D HAVE_MEMCACHE_SESSION=1 -Iext/pcre/pcre2lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /D HAVE_CONFIG_H /D HAVE_MEMMOVE /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /Iext\raphf /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /DHAVE_WINSOCK_H=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /D PHP_SOCKETS_EXPORTS=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /I "..\deps\include" /DHAVE_SQLITE3_H=1 /DHAVE_SQLITE3EXT_H=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /I "ext/date/lib" /DHAVE_TIMELIB_CONFIG_H=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1  /D ZLIB_EXPORTS /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /I "..\deps\include\libxml2" /DHAVE_LIBXML_PARSER_H=1 /DHAVE_LIBXML_TREE_H=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /D LIBXML_STATIC /D LIBXML_STATIC_FOR_DLL /D HAVE_WIN32_THREADS /I "..\deps\include\libxml2" /DHAVE_LIBXML_PARSER_H=1 -Iext/dom/lexbor /D LEXBOR_STATIC /D LIBXML_STATIC /DHAVE_MBSTRING_H=1  -Iext/mbstring -Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl /D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1  /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /I "..\deps\include" /DHAVE_SQLITE3_H=1 /DHAVE_SQLITE3EXT_H=1 /W3 /I "..\deps\include" /DHAVE_ZLIB_H=1 /I "ext\pecl_http\..\hash" /DHTTP_HAVE_PHP_HASH_H=1 /DHAVE_CURL_CURL_H=1 /DHAVE_OPENSSL_CRYPTO_H=1 /Iext\pecl_http /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /D PHP_SESSION=1 /I "..\deps\include\libxml2" /DHAVE_LIBXML_TREE_H=1 /D LIBXML_STATIC /D PHP_SIMPLEXML_EXPORTS /I "..\deps\include\libxml2" /DHAVE_LIBXML_PARSER_H=1 /DHAVE_LIBXML_TREE_H=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /D LIBXML_STATIC /I "..\deps\include\libxml2" /DHAVE_LIBXML_PARSER_H=1 /DHAVE_LIBXML_TREE_H=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /D LIBXML_STATIC /I "..\deps\include\libxml2" /DHAVE_LIBXML_PARSER_H=1 /DHAVE_LIBXML_TREE_H=1 /D LIBXML_STATIC /I "..\deps\include\libxml2" /DHAVE_LIBXML_XMLWRITER_H=1 /D LIBXML_STATIC /nologo /I . /I main /I Zend /I TSRM /I ext /D _WINDOWS /D WINDOWS=1 /D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /D _USE_MATH_DEFINES /FD /wd4996 /RTC1 /Zc:__cplusplus /d2FuncCache1 /Zc:preprocessor /Zc:wchar_t /LDd /MDd /Od /D _DEBUG /D ZEND_DEBUG=1 /Zi /I "..\deps\include" /D FD_SETSIZE=256 /FpC:\php\Debug\main\ /FRC:\php\Debug\main\ /FdC:\php\Debug\main\ /c main\internal_functions.c /FoC:\php\Debug\main\internal_functions.obj' : return code '0x2'
Stop.
The command 'cmd /S /C configure --enable-object-out-dir=%PHP_OUT_DIR% --with-php-build=..\deps %PHP_PARAMETERS%    && nmake' returned a non-zero code: 2

I am getting this error when I am done with the configure command and ran the nmake command to compile the php.
My environment:
OS: Windows servercore 2022 (Docker image)
Arch: x64
PHP: 8.4.2 (compiled directly from the source code), NTS mode
VS version:  17
I have followed the steps mentioned in this document (https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2)
Can anyone please help why I am getting this issue? Is there a way to fix it?
Any help would be appreciated. Thanks in Advance.

aravind jayanthi

unread,
Jan 28, 2025, 10:55:38 AM (13 days ago) Jan 28
to grpc.io
Just following up on the issue.
Reply all
Reply to author
Forward
0 new messages