I think I did quite a good job on installing PDFlib on a system (Ubuntu 18.04) but something’s not totally right yet. What I did so far:
- Followed the instructions here: https://www.pdflib.com/fileadmin/pdflib/pdf/support/PDFlib-in-PHP-HowTo.pdf
- Downloaded the correct
php_pdflib.so
file and placed it in the extension directory I got throughphpinfo()
- Added
extension=php_pdflib.so
in myphp.ini
- Ran a
sudo systemctl restart apache2
to restart Apache and reload extensions -
Checked with
php -i | grep PDF
whether the binary was loaded or not, result seems positivePDFlib PDFlib Support => enabled PDFlib GmbH Binary-Version => 9.2.0
Now, when I run phpinfo();
from the web side through a file, there is no mention of PDFlib at all. When I run it through CLI, everything seems to be okay.
I also tried creating a new PDFlib() instance through CLI and web. CLI works, web doesn’t.
Did I miss something in the install process?
2
Answers
Being not a good engineer today, I did several things at once, so I can't tell what exactly worked out in the end. Will write down my steps nevertheless, as it works now.
php -i
and aphpinfo();
to see the differences between CLI and web frontend.extension=php_pdflib
from both php.ini filesphp_pdflib.so
from the extension directory one level up, it now lives in/usr/lib/php
directlyphplib.so
(but that was more to break things on purpose and see what happens30-pdflib.ini
file in/etc/php/7.3/fpm/conf.d
and wrote onlyextension=/usr/lib/php/pdflib.so
in it/etc/php/7.3/cli/php.ini
to see if there's a differencephpinfo()
did not show any changes for the loaded configuration files or modulessudo reboot
So, not sure if a hard reboot really fixed this, but it seems to me like that. Maybe this helps someone else.
this is a typical situation. The PHP CLI and the PHP within the web server could have different configuration. So please check the extension_dir as well which the php.ini which was loaded in your web server phpinfo() output. Then you have do the the same configuration. Please check as well the PHP/Webserver log file for any error messages. Maybe it might be NTS/TS (threading) issue as well, but this will be mentioned in the error message.