Sebastian F.
Sebastian F.

Reputation: 1

Unable to install PDFLib on PHP and Apache2 on MacOS

So, I hope you can help me. I can't seem to get the PHP extension of PDFLib to work on my macOS System due to some security features of macOS:

if I restart the server it says this:

PHP Warning:  PHP Startup: Unable to load dynamic library 'php_pdflib.so' (tried: /usr/local/lib/php/ext/php_pdflib.so (dlopen(/usr/local/lib/php/ext/php_pdflib.so, 9): no suitable image found.  Did find:\n\t/usr/local/lib/php/ext/php_pdflib.so: code signature in (/usr/local/lib/php/ext/php_pdflib.so) not valid for use in process using Library Validation: mapping process is a platform binary, but mapped file is not\n\t/usr/local/lib/php/ext/php_pdflib.so: file system sandbox blocked stat()), /usr/local/lib/php/ext/php_pdflib.so.so (dlopen(/usr/local/lib/php/ext/php_pdflib.so.so, 9): image not found)) in Unknown on line 0

code signature not valid? Is there a solution or workaround? FYI: Updated PEAR, PECL, PHP is Version 7.4.23, macOS BigSur 11.2.3 (20D91) PHP installed via Homebrew

Upvotes: 0

Views: 382

Answers (1)

Rainer
Rainer

Reputation: 2185

no suitable image found.

this is an indicator that your used Environment does not match the supported platform in the PDFlib DSO.

Is it possible that you are using PHP on a new Apple M1 (ARM) processor? Currently PDFlib PHP for macOS is only available for Intel64.

(1)$ file php_pdflib.so
php_pdflib.so: Mach-O 64-bit bundle x86_64

Is this the case which might apply to you?

You could check this by using file on your PHP executable and php_pdflib.so to check which platform you are using. Currently you can only use PDFlib in PHP via Rosetta2 (Intel hardware emulation).

Upvotes: 0

Related Questions