Search code examples
phppleskpeclpdflib

php version in plesk - extension installing on wrong version


I've just installed plesk on centos 7, it has multiple php versions installed. 7.1.10 was turned on and was the preferred version to use However, i've tried to install phplib but it never loads on 7.1.10.

Have installed phplib perfectly fine, yet when you place pdf.so on the php.ini file it never load the extension.

I then noticed that pecl was installing the files in /usr/lib64/php/modules when php claimed they were in /opt/plesk/php/7.1/lib64/php/modules That got me thinking that it must be installing it on a different php version, so I turned on the default php version of 5.4.16 and what do we have? pdf.so now loads and displays pdflib in the php config page.

Any ideas how to get it working on php 7 under plesk?


Solution

  • I would recommend to do the typical installations steps.

    • download the current PDFlib package for your Linux (64-bit) PHP and unpack the archive on your server
    • pick the correct PDFlib PHP DSO for your used PHP version (see bind/php/php-*)
    • get the correct extension_dir path from your phpinfo() output.
    • copy the PDFlib PHP DSO to the extension_dir
    • determine the correct php.ini from the phpinfo() output
    • add extension=php_pdflib.so to the php.ini

    after a restart of your webserver, you should see a "PDFlib" section in the phpinfo() output.

    Please see also the PDFlib in PHP Howto or PDFlib 9.1 Tutorial, chapter 2.9 "PHP Binding" for more detailed introduction how to install PDFlib.