【问题标题】:Thermal Printing over website(on amazon server) using PHP使用 PHP 在网站上进行热敏打印(在亚马逊服务器上)
【发布时间】:2016-07-17 21:22:37
【问题描述】:

我已经通过以太网电缆将 EPSON TM-T81 热敏打印机连接到路由器并提供了一个 IP 地址,即 192.168.1.12 和

我有一个托管在亚马逊服务器上的网站,我想直接通过网络打印收据。

我正在使用以下库进行打印。

您可以查看下图它是如何工作的

https://github.com/mike42/escpos-php

如果我从 localhost 进行测试,我可以找到打印机并且打印工作正常,但是当我尝试从站点打印时,它会显示以下错误

<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at 
 [no address given] to inform them of the time this error occurred,
 and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>

从我的调试中我发现它找不到打印机,所以它不能生成套接字对象。

我需要在亚马逊上设置什么吗?

客户端 PC 在 Windows 8 上运行,我已经在其中安装了 epson 驱动程序。

【问题讨论】:

  • 如果您尝试通过互联网连接到 192.168.1.12 - 这将不起作用,所有 192.168.xx 地址都是私有的,并且只能在同一个本地网络中路由。

标签: php amazon-web-services printing thermal-printer epson


【解决方案1】:

您的热敏打印机位于路由器后面,因此您需要将网络数据包从 Internet 转发到此打印机。如果您的路由器非常先进,那么您可以设置防火墙规则以匹配来自/到此打印机的网络数据包并转发它。如果您使用 SOHO 路由器,请查看您的路由器文档是否支持端口转发。如果您在 ServerFault 中询问他们,我认为您会得到更多回复。 StackOverflow 是关于编程 QA 的

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-07-24
    • 1970-01-01
    • 1970-01-01
    • 2017-06-06
    • 2011-07-13
    • 2015-05-02
    • 2015-08-17
    • 1970-01-01
    相关资源
    最近更新 更多