Home » Php » php – php_printer() Not Working on Cpanel Server Side

php – php_printer() Not Working on Cpanel Server Side

Posted by: admin February 25, 2020 Leave a comment

Questions:

i am doing web application based on php ,
while i am forcing my content to network printer
the following error was happening..

Fatal error: Uncaught Error: Call to undefined function printer_open()
in E:\xampp\htdocs\print\index.php:3 Stack trace: #0 {main} thrown in
E:\xampp\htdocs\print\index.php on line 3

my codes :

$php_content='Test Print';

$handle = printer_open("\\192.168.2.4\EPSON L365 Series");

printer_write($handle, $php_content);

printer_close($handle);

I am adding php_printer.dll file to xampp/php/ext folder
and adding the extension=php_printer into php.ini file

After restarting my xampp server its working fine on locally.

Same code I was executed on my Cpanel server HTTP ERROR 500 was showing.

Kindly give the solution for this..
Thanks in advance.

How to&Answers: