0

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?

Edited by sri.

4
Contributors
8
Replies
30
Views
5 Years
Discussion Span
Last Post by akgreen
0

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

1

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.

0

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

Edited by sri.

2

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.

0

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

1

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.

Votes + Comments
thanks for sharing
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.