【问题标题】:Php printer Out of memory errorphp打印机内存不足错误
【发布时间】:2013-09-23 11:29:11
【问题描述】:

我想使用打印机扩展 PHP。所以我下载了 dll 并将其安装在我的 wamp 服务器上,但是现在,当我想打开我的打印机时,我遇到了这个问题:

代码如下:

$printer = "\\\\MARKETING1-PC\\Canon LBP2900"; 
if($ph = printer_open($printer)) 
{ 

   $content = 'test';


   // Set print mode to RAW and send PDF to printer 
   printer_set_option($ph, PRINTER_MODE, "RAW"); 
   printer_write($ph, $content); 
   printer_close($ph); 
} 
else "Couldn't connect..."; 

错误是

 Fatal error: Out of memory (allocated 1048576) (tried to allocate 4294967295 bytes) in C:\wamp\www\test\sell_report.php on line 10

可能是我下载的dll有问题?

【问题讨论】:

  • 4,294,967,295 字节? 4GB 是很多内存!
  • 第 10 行是哪一行?
  • @MikeBrant 正好在 if 行
  • @SurrealDreams 是的,我认为问题可能出在 dll 上

标签: php apache pecl


【解决方案1】:

我会先尝试本地打印机,而无需通过网络。

此外,打印机扩展是为 PHP4 编写的,从未正式发布过。我怀疑它是否可用。

您最好生成 PDF 或 .ps 文件并使用 CLI 命令打印它们。

【讨论】:

  • 我的朋友,至少我可以连接到打印机,我的问题出在网络上,当我在本地尝试时没问题
猜你喜欢
  • 2012-10-25
  • 1970-01-01
  • 2014-06-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多