I have a question about printing files using php scripting .
is there any linux printing library to be installed on the server ? i've tried the lpr command with exec , shell_exec , and system functions . but non of theme worked with me .
example 1:
$filedir = "/home/user/domains/domain.com/public_html/print/file/test.txt" ;
echo shell_exec("lpr $filedir");
example 2:
$filedir = "/home/user/domains/domain.com/public_html/print/file/test.txt" ;
echo shell_exec("lpr -P printername $filedir");
example 3:
$filedir = "/home/user/domains/domain.com/public_html/print/file/test.txt" ;
echo exec("lpr $filedir");
example 4:
$filedir = "/home/user/domains/domain.com/public_html/print/file/test.txt" ;
echo shell_exec("lpr -P printername $filedir");
example 5:
$filedir = "/home/user/domains/domain.com/public_html/print/file/test.txt" ;
echo system("lp $filedir");
also iv'e tried this class here but it shows me a warning msg and print nothing
Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to tcp://1.1.1.1:515 (Connection timed out) in /home/user/domains/domain.com/public_html/print/PrintSendLPR.php on line 122
also i have checked a lot of examples as here , here , and here
any help please ! i have to print out a file with php code which is hosted on a Linux server , i need to connect to the user's default printer or to install a printer-library/driver into the server .
Many thanks