libvips / php-vips

php binding for libvips
MIT License
615 stars 25 forks source link

Add a hint how to detect Vips is correctly installed #252

Open alexander-schranz opened 2 days ago

kleisauke commented 1 day ago

FWIW, this can probably be simplified to just:

$ php -r "require_once('vendor/autoload.php'); echo 'libvips version: ' . \\Jcupitt\\Vips\\Config::version() . PHP_EOL;"
libvips version: 8.16.0

Since almost all checks mentioned in this PR are covered here: https://github.com/libvips/php-vips/blob/a8cc66c421f5b71568f9cf52a5bfcb818af52142/src/FFI.php#L239-L249

For example, when I remove the zend.max_allowed_stack_size = -1 setting in php.ini, I see:

$ php -r "require_once('vendor/autoload.php'); echo 'libvips version: ' . \\Jcupitt\\Vips\\Config::version() . PHP_EOL;"
PHP Fatal error:  Uncaught Jcupitt\Vips\Exception: zend.max_allowed_stack_size not set to '-1' in /home/kleisauke/php-vips/src/FFI.php:248
Stack trace:
#0 /home/kleisauke/php-vips/src/FFI.php(150): Jcupitt\Vips\FFI::init()
#1 /home/kleisauke/php-vips/src/Config.php(149): Jcupitt\Vips\FFI::version()
#2 Command line code(1): Jcupitt\Vips\Config::version()
#3 {main}
  thrown in /home/kleisauke/php-vips/src/FFI.php on line 248