i am using php 5.4.3

I have this code:
<?php
$handle = printer_open();
printer_write($handle, "Text to print");
printer_close($handle);
?>
when i run get below error message :

Fatal error: Call to undefined function: printer_open()...
What could be wrong?

thanks cereal for your advice

i download the file php_printer.dll and put it in "ext" folder and after it i made some changes in php.ini

i add the line
;extension=php_printer.dll in php.ini

but i still got the error....

my code is

$handle = printer_open();
$handle = printer_write($handle, "Text to print");
printer_close($handle);

and the error which i got ...

Fatal error: Call to undefined function printer_open() in

i need help on it....plz

thanks in advance

Without the semicolon otherwise you comment the line and it's not considered: extension=php_printer.dll

After you save the file reload the server and it should work.

i removed semicolon and then refresh the server while i got some error

Error:

Php Startup: printer:unable to initialize module

Module Complied with module API=20060613

PHP complied with module API=20090626

these option need to match

Thanks cereal for your guidance

I cannot help you much on this, I've seen this problem when using two different versions of PHP on the same box, but in linux is simple to solve: just change the path before using phpize... in windows, since you are placing the dll, try the other versions of php_printer.dll http://downloads.php.net/pierre/ otherwise, I think, you have to compile the dll on your own.

thanks cereal

sir
i'm new to PHP... i'm in serious need of php_printer.dll to work in my windows-7 64bit OS, ive tried every dll's available..when i run i get server error message ... please some how help me in making this work...
i'm using wamp server wit php 5.4 version and aptana3

I am running php 5.4 with Apache 2 on a Win 2008/64 server. I have PHP print functions working just fine. The script is also working on Win7/64 testbed system. I am using the printer.dll extracted from
php_printer-svn20100319-5.3-vc6-x86.zip. I assume this date is the date of the dll. I downloaded this zip from a php site on the web. I can't speak to WAMP and APTANA, but maybe it is similar to Apache / PHP servers:
(a) Apache has to be configured for php

 LoadModule php5_module "D:/Programs/php/php5apache2_2.dll"

(b) PHP.ini has to specify the extensions directory, like: extension_dir="c:\php\ext"
(c) the php_printer.dll has to be in the extensions directory
(d) PHP.ini has to specify loading the dll: extension=php_printer.dll
(e) restart your http server, which will reload PHP configuration.
(f) run phpinfo.php to verify printer configuration.
Hope this helps - if not, its all I've got.

commented: thanks for sharing +11
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.