File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 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.
5353Of course if attackers are running their own PHP code on your webserver you
5454are probably already toast, unfortunately.
5555
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+
5668### Example
5769
5870``` php
Original file line number Diff line number Diff line change @@ -236,13 +236,17 @@ private static function init(): void
236236 return ;
237237 }
238238
239- // the two usual installation problems
239+ // detect the most common installation problems
240240 if (!extension_loaded ('ffi ' )) {
241241 throw new Exception ('FFI extension not loaded ' );
242242 }
243243 if (!ini_get ('ffi.enable ' )) {
244244 throw new Exception ("ffi.enable not set to 'true' " );
245245 }
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+ }
246250
247251 $ vips_libname = self ::libraryName ("libvips " , 42 );
248252 if (PHP_OS_FAMILY === "Windows " ) {
You can’t perform that action at this time.
0 commit comments