2012-09-09 99 views
-1

我使用的XAMPP,並添加ext文件夾內php_printer.dll,打開了php.ini中寫下如下: extension=php_printer.dll沒有;將擴展添加到PHP.ini?

我創建了一個頁面print.php測試

<?php 
$handle =printer_open("Xerox Phaser 6120 PS"); 
$handle = printer_open(); 
?> 

和差錯出現了: 致命錯誤:調用printer_open未定義的函數()在C:\ XAMPP \ htdocs中\上線架\ print.php 2

那有什麼不對?

+0

您確定您在擴展文件夾中有.dll文件嗎? apache是​​否報告日誌中的一些錯誤?你在哪裏找到這個DLL? –

+0

@glavic我從這個網站下載了.dll文件http://downloads.php.net/pierre/ ..向下滾動查找2010文件。 –

回答

0

php_printer.dll是一個古老的擴展,不知道這是否仍與最近的PHP作品,未經編譯

但有一個已知的解決方法,您可以將輸出轉換爲PDF,然後使用命令行使用Adobe Reader PDF格式的可執行如下所示

//with print dialog 
$print = `<PATH to acrobat reader>AcroRd32.exe /P PdfFile` 

//silent print 
$print = `<PATH to acrobat reader>AcroRd32.exe /N /T PdfFile PrinterName`