2016-03-30 35 views
0
網站(亞馬遜的服務器上),熱敏打印

我已連接愛普生TM-T81熱敏打印機通過以太網電纜連接到路由器,並給了一個IP地址192.168.1.12即與在使用PHP

我有託管在一個網站亞馬遜服務器,我想直接通過網絡打印收據。

我正在使用以下庫進行打印。

您可以檢查下圖將如何運作

enter image description here

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

如果我從本地主機比我能找到打印機測試和印刷工作正常,但當我嘗試從打印它顯示我下面的錯誤

<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> 

從我的調試我發現它找不到printe因此它不能生成套接字對象。

我需要在亞馬遜上設置任何東西嗎?

客戶端PC運行在Windows 8上,我已經安裝了epson驅動程序。

+0

如果您嘗試通過互聯網連接到192.168.1.12 - 這是行不通的,所有192.168.x.x地址都是私有的,並且只能在同一本地網絡中路由。 – ahoffner

回答

0

您的熱敏打印機位於路由器後面,因此您需要將網絡數據包從Internet轉發到此打印機。如果您的路由器相當先進,那麼您可以設置防火牆規則以匹配來自/來自此打印機的網絡數據包並轉發它。如果您使用SOHO路由器,請參閱您的路由器文檔,看他們是否支持端口轉發。如果你在ServerFault中問他們,我想你會得到更多的迴應。 StackOverflow是關於編程QA