I am trying to use PHP to print to a server side printer. I have found similar example code that mostly all use the same API’s functions in order to do this task. When I ran it on my server to test the code it was saying “PHP Fatal error: Call to undefined function printer_open()”. So I found at least three different versions of the php_printer.DLL’s for this printer function and tried them all separately . I did some more research and looking into the apache server error log found this warning
PHP Warning: PHP Startup: Unable to load dynamic library ‘ext\php_printer.dll’ - The specified module could not be found.\r\n in Unknown on line 0
From this found some Bing search results that said that the reason it is not loading when apache starts up is because it is depend on other libraries. If this is true I have not as yet been able to find which library DLL’s these are and where to get them. This is what I need help with first to basically know if it is not depended then why is the PHP warning being thrown or what library’s do I need. Thanks for any help
zac
I am running a wampserver2.2
Apache 2.4.2
PHP 5.4.3
OS : windows 7 64 bit
Added to the php.ini file
extension=php_printer.dll
and no errors in the php log
also I did restarted the server each time I change the php.ini file or when I put a new DLL in the ext\ directory
I even put the path to the wamp DLL’s “...\ext\” in the environment variables for windows, as a shoot in the dark .
Example code
[php]<?php
$lipsum = “test print”;//file_get_contents(‘lipsum.txt’);
phpinfo();/not displaying the Module for the printer/
/* open a connection to the printer */
$printer = printer_open("Microsoft XPS Document Writer");/*stops here with error*/
/* write the text to the print job */
printer_write($printer, $lipsum);
/* close the connection */
printer_close($printer);
?>[/php]