use correct musl lib

This commit is contained in:
DubbleClick 2025-07-22 12:42:45 +07:00
parent a0f474db20
commit 206bc95ee2
2 changed files with 4 additions and 3 deletions

View File

@ -183,7 +183,8 @@ class SystemUtil
} elseif (is_file('/usr/local/musl/lib/libc.so')) { } elseif (is_file('/usr/local/musl/lib/libc.so')) {
$result = shell()->execWithResult('/usr/local/musl/lib/libc.so 2>&1', false); $result = shell()->execWithResult('/usr/local/musl/lib/libc.so 2>&1', false);
} else { } else {
$result = shell()->execWithResult('/lib/ld-musl-x86_64.so.1 2>&1', false); $arch = php_uname('m');
$result = shell()->execWithResult("/lib/ld-musl-{$arch}.so.1 2>&1", false);
} }
// Match Version * line // Match Version * line
// match ldd version: "Version 1.2.3" match 1.2.3 // match ldd version: "Version 1.2.3" match 1.2.3

View File

@ -8,10 +8,10 @@ int main(int argc,char **argv){
zend_stream_init_filename(&file_handle,"embed.php"); zend_stream_init_filename(&file_handle,"embed.php");
if(php_execute_script(&file_handle) == FAILURE){ if(!php_execute_script(&file_handle)){
php_printf("Failed to execute PHP script.\n"); php_printf("Failed to execute PHP script.\n");
} }
PHP_EMBED_END_BLOCK() PHP_EMBED_END_BLOCK()
return 0; return 0;
} }