File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,18 @@ server can use it to call any native library they have access to.
53
53
Of course if attackers are running their own PHP code on your webserver you
54
54
are probably already toast, unfortunately.
55
55
56
+ Finally, on php 8.3 and later you need to disable stack overflow
57
+ tests. php-vips executes FFI callbacks off the main thread and this confuses
58
+ those checks, at least in php 8.3.0.
59
+
60
+ Add:
61
+
62
+ ```
63
+ zend.max_allowed_stack_size=-1
64
+ ```
65
+
66
+ To your ` php.ini ` .
67
+
56
68
### Example
57
69
58
70
``` php
Original file line number Diff line number Diff line change @@ -236,13 +236,17 @@ private static function init(): void
236
236
return ;
237
237
}
238
238
239
- // the two usual installation problems
239
+ // detect the most common installation problems
240
240
if (!extension_loaded ('ffi ' )) {
241
241
throw new Exception ('FFI extension not loaded ' );
242
242
}
243
243
if (!ini_get ('ffi.enable ' )) {
244
244
throw new Exception ("ffi.enable not set to 'true' " );
245
245
}
246
+ if (version_compare (PHP_VERSION , '8.3 ' ) &&
247
+ ini_get ('zend.max_allowed_stack_size ' ) != '-1 ' ) {
248
+ throw new Exception ("zend.max_allowed_stack_size not set to '-1' " );
249
+ }
246
250
247
251
$ vips_libname = self ::libraryName ("libvips " , 42 );
248
252
if (PHP_OS_FAMILY === "Windows " ) {
You can’t perform that action at this time.
0 commit comments