• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Cant install VIPS for PHP

Martin.H

Regular Pleskian
I'm searching for a tutorial like this one (How to install APCu module on Plesk server?) but just for installing VIPS for PHP.


My System
OS
: Debian 9.11
Plesk: Obsidian 18.0.21 Update 5
PHP Versions: 7.1, 7.2, 7.3, 7.4


I already did this:

1. pre:
yes '' | apt-get install libvips-dev libvips42 libvips-tools re2c
yes '' | apt-get install plesk-php71-dev

yes '' | apt-get install plesk-php72-dev
yes '' | apt-get install plesk-php73-dev
yes '' | apt-get install plesk-php74-dev


2. Install:
yes '' | /opt/plesk/php/7.1/bin/pecl install vips
yes '' | /opt/plesk/php/7.2/bin/pecl install vips
yes '' | /opt/plesk/php/7.3/bin/pecl install vips
yes '' | /opt/plesk/php/7.4/bin/pecl install vips


3. move:
echo "extension=vips.so" > /opt/plesk/php/7.1/etc/php.d/vips.ini
echo "extension=vips.so" > /opt/plesk/php/7.2/etc/php.d/vips.ini
echo "extension=vips.so" > /opt/plesk/php/7.3/etc/php.d/vips.ini
echo "extension=vips.so" > /opt/plesk/php/7.4/etc/php.d/vips.ini


4. configurate PHP:
service plesk-php71-fpm restart
service plesk-php72-fpm restart
service plesk-php73-fpm restart
service plesk-php74-fpm restart
plesk bin php_handler --reread


5. check is loaded:
But when I check it, it always keeps telling me:
# /opt/plesk/php/7.1/bin/php -i | grep vips
PHP Warning: PHP Startup: vips: Unable to initialize module
Module compiled with module API=20151012
PHP compiled with module API=20160303
These options need to match


# /opt/plesk/php/7.2/bin/php -i | grep vips
PHP Warning: PHP Startup: vips: Unable to initialize module
Module compiled with module API=20151012
PHP compiled with module API=20170718
These options need to match


# /opt/plesk/php/7.3/bin/php -i | grep vips
PHP Warning: PHP Startup: vips: Unable to initialize module
Module compiled with module API=20151012
PHP compiled with module API=20180731
These options need to match


# /opt/plesk/php/7.4/bin/php -i | grep vips
PHP Warning: PHP Startup: vips: Unable to initialize module
Module compiled with module API=20151012
PHP compiled with module API=20190902
These options need to match

6. addtional Infos:
# vips -v
vips-8.4.5-Fri Jan 18 18:15:36 UTC 2019


# pkg-config vips --modversion
8.4.5


# /opt/plesk/php/7.4/bin/pecl install vips
downloading vips-1.0.10.tgz ...
Starting to download vips-1.0.10.tgz (558,528 bytes)
.................................................................................................................done: 558,528 bytes
4 source files, building
running: phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012

I understand that these module APIs have to match, but how do I install a matching version for every single PHP Version? Also strange: its not even matching the module API for the PHP version 7.1 (the lowest I use)
Evene when I run "# /opt/plesk/php/7.4/bin/pecl install vips" it installes it for PHP Api Version 20151012 and I dont understand why. (see additional Info #3)

I think pecl is using the wrong phpize.. its using 20151012 which stands for PHP 7.0, but PHP 7.0 is not even installed on my machine.
So does anyone know how to solve the problem and how to make "/opt/plesk/php/7.4/bin/pecl" using the phpize from PHP 7.4 so I can install the right versions of my pecl extensions?

Hope someone can help me installed VIPS (libvips) in Plesk so that its working properly.

Related Links: php-vips-ext, libvips, php-vips

Thanks in advance!
merry Xmas btw :)

#EDIT: solved the problem, did somehow not install plesk-php7[1-4]-dev even if I tought I did. This was causing that phpize was not installed. So "# /opt/plesk/php/7.3/bin/phpize --version" was not working and it did a fallback to the one the System is using (PHP 7.0)
Its working now.
 
Last edited:
Just wanted to share my "selfmade" script to install VIPS for Plesk (Debian)
This script(s) are made in a way so they will not fire any errors if things are already installed and will install everything necessary to make VIPS (for PHP) working, also no promts or anything else.

I have tested this on Plesk Onyx 17.8 and Plesk Obsidian 18.0

#VIPS für PHP (7.4)
yes '' | apt-get install libvips-dev libvips42 libvips-tools re2c plesk-php74-dev && if ! /opt/plesk/php/7.4/bin/pecl list | grep vips >/dev/null 2>&1; then yes '' | /opt/plesk/php/7.4/bin/pecl install vips || { echo_err "Pecl (PHP 7.4) could not install VIPS"; exit 1; } fi && echo "extension=vips.so" > /opt/plesk/php/7.4/etc/php.d/vips.ini && service plesk-php74-fpm restart && plesk bin php_handler --reread​

#VIPS für PHP (7.3)
yes '' | apt-get install libvips-dev libvips42 libvips-tools re2c plesk-php73-dev && if ! /opt/plesk/php/7.3/bin/pecl list | grep vips >/dev/null 2>&1; then yes '' | /opt/plesk/php/7.3/bin/pecl install vips || { echo_err "Pecl (PHP 7.3) could not install VIPS"; exit 1; } fi && echo "extension=vips.so" > /opt/plesk/php/7.3/etc/php.d/vips.ini && service plesk-php73-fpm restart && plesk bin php_handler --reread​

#VIPS für PHP (7.2)
yes '' | apt-get install libvips-dev libvips42 libvips-tools re2c plesk-php72-dev && if ! /opt/plesk/php/7.2/bin/pecl list | grep vips >/dev/null 2>&1; then yes '' | /opt/plesk/php/7.2/bin/pecl install vips || { echo_err "Pecl (PHP 7.2) could not install VIPS"; exit 1; } fi && echo "extension=vips.so" > /opt/plesk/php/7.2/etc/php.d/vips.ini && service plesk-php72-fpm restart && plesk bin php_handler --reread​

#VIPS für PHP (7.1)
yes '' | apt-get install libvips-dev libvips42 libvips-tools re2c plesk-php71-dev && if ! /opt/plesk/php/7.1/bin/pecl list | grep vips >/dev/null 2>&1; then yes '' | /opt/plesk/php/7.1/bin/pecl install vips || { echo_err "Pecl (PHP 7.1) could not install VIPS"; exit 1; } fi && echo "extension=vips.so" > /opt/plesk/php/7.1/etc/php.d/vips.ini && service plesk-php71-fpm restart && plesk bin php_handler --reread​

#VIPS für PHP (7.0)
yes '' | apt-get install libvips-dev libvips42 libvips-tools re2c plesk-php70-dev && if ! /opt/plesk/php/7.0/bin/pecl list | grep vips >/dev/null 2>&1; then yes '' | /opt/plesk/php/7.0/bin/pecl install vips || { echo_err "Pecl (PHP 7.0) could not install VIPS"; exit 1; } fi && echo "extension=vips.so" > /opt/plesk/php/7.0/etc/php.d/vips.ini && service plesk-php70-fpm restart && plesk bin php_handler --reread​


Now "vips" should be available and already ticked in your Plesk Backend at "Tools and Settings" --> "PHP-Settings" --> [Chose PHP Version you have installed it for]:
QX3RgNK.png


Have fun!
 
@IgorG would be awesome if someone could past this to a official tutorial. Think some people could use it. Finding it in the official docs would be better
 
@IgorG would be awesome if someone could past this to a official tutorial. Think some people could use it. Finding it in the official docs would be better
Sorry, but we do not publish in the official documentation solutions that have not been tested by our QA team.
I think that it would be the right decision to publish your recipe here. This is quite an official place for various custom solutions.
 
Back
Top