安装pdf扩展
1. wget http://pecl.php.net/get/pdflib-4.1.2.tgz 2. tar zxvf pdflib-4.1.2.tgz 3. cd pdflib-4.1.2.tgz 4. /opt/lampp/bin/phpize 5. ./configure --with-php-config=/opt/lampp/bin/php-config 6. make && make install 7. vim /opt/lampp/etc/php.ini 添加extension="pdf.so" 8. 重启XAMPP:/opt/lampp/xampp restart
如果报错信息是:Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20131226/pdf.so' - libpdf.so.6: cannot open shared object file: No such file or directory in Unknown on line 0
解决方法是:cp /usr/local/lib/libpdf.so.6 /usr/local/lib64/
说明编译好的64位库没有安装到/usr/local/lib64/目录下
或修改第5步骤:./configure --with-php-config=/opt/lampp/bin/php-config --libdir=/usr/local/lib64/
以上是如何在Linux环境下安装XAMPP的PHP的PDF扩展的详细内容。更多信息请关注PHP中文网其他相关文章!