安裝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中文網其他相關文章!