Skip to content

GREP_HEADER() is broken #16199

Closed
Closed
@nono303

Description

@nono303

Description

Hi,

testing compilation on MSVC (vs17 x64) of PHP 8.4.0RC1 configure --with-openssl-argon2 with openssl 3.3.2

  1. had the error:
Enabling extension ext\openssl [shared]
Checking for OSSL_set_max_threads in openssl/thread.h ... 
Checking for openssl/thread.h ...  <not found>
Checking for openssl/thread.h ...  C:\sdk\release\vs17_x64-avx2\_openssl\openssl\include
Problem reading C:\sdk\release\vs17_x64-avx2\_openssl\openssl\include
No
WARNING: OpenSSL argon2 hashing requires OpenSSL >= 3.2
  1. checked all the stuff on openssl part : no problem
  2. looked why the message Problem reading C:\sdk\release\vs17_x64-avx2\_openssl\openssl\include didn't include the filename and realize that GREP_HEADER in /win32/build/confutils.js is buggy:

header_name is only appended in file_get_contents() param when path_to_check() is set and not when path come from search_paths() result.

  1. here is a working path
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -968,11 +968,11 @@ function GREP_HEADER(header_name, regex, path_to_check)
 
 		var p = search_paths(header_name, path_to_check, "INCLUDE");
 		if (typeof(p) == "string") {
-			c = file_get_contents(p);
+			c = file_get_contents(p+ "\\" + header_name);
 		} else if (p == false) {
 			p = search_paths(header_name, PHP_EXTRA_INCLUDES, null);
 			if (typeof(p) == "string") {
-				c = file_get_contents(p);
+				c = file_get_contents(p+ "\\" + header_name);
 			}
 		}
 		if (!c) {
  1. configure log after patch
Enabling extension ext\openssl [shared]
Checking for OSSL_set_max_threads in openssl/thread.h ... 
Checking for openssl/thread.h ...  <not found>
Checking for openssl/thread.h ...  C:\sdk\release\vs17_x64-avx2\_openssl\openssl\include
OK

Note: Don't know where the useless No and OK message line come from... might be removed

PHP Version

PHP 8.4.0RC1

Operating System

Win11

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions