Hi Richard, Many, many thanks, that has done the trick. ****BUT**** I had to turn it off. I have had to set fastcgi.impersonate=0 to fix it, which makes sense in a way because the user under which IIS runs has been given access to print, but the user browsing the site has not. I don't use any form of logging onto the site, so I would not know what user it was... Thanks again, Paul Giesberts IT & QA Manager Servicecare -----Original Message----- From: Richard Quadling [mailto:rquadling@xxxxxxxxxxxxxx] Sent: 05 May 2009 13:23 To: Paul Giesberts Cc: php-windows@xxxxxxxxxxxxx Subject: Re: printing on IIS7 2009/5/5 Paul Giesberts <p.giesberts@xxxxxxxxxxxxxxxxxx>: > Hi, > > I have migrated a php site from Linux to windows. The only remaining problem seems to be printing, naturally I have had to change the code and that's where the problems have started. I have the following very simple code: > > <?php > > $txt = "Hello World"; > $handle = printer_open("DELL3115"); > printer_write($handle, $txt); > printer_close($handle); > ?> > > When I run this from the command prompt using php -f ..... It works fine, in other words it prints, when I run this script through the web browser then I get this: > > Fatal error: Out of memory (allocated 262144) (tried to allocate > 4294967295 bytes) in C:\inetpub\wwwroot\testprn.php on line 4 > > I have read this article: http://support.microsoft.com/?kbid=184291 and many others, which all lead me to believe that it is an account / permission problem. On a side note: $handle = printer_open("non-existing-printer"); gives me a normal error in the sense of "can't find printer". > > I run Windows 2008 64 bit, IIS7, php 5.2 32 bit ( I have enabled 32 bit apps in IIS and the rest of the site works fine), using FastCGI. > Has anyone got any ideas? > > Thanks, > Paul Giesberts > IT & QA Manager > ------------------------------------------------------------- > Servicecare > Manchester Road > Oldham > OL9 7AA > ------------------------------------------------------------- > DDI: ++44-161-6881985 > Tel: ++44-161-6881999 > Fax: ++44-161-6881998 > email: p.giesberts@xxxxxxxxxxxxxxxxx > > -- > PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: > http://www.php.net/unsub.php > > Strangely enough, I've just had a very similar issue with another application (Timeware needing to print a "Who Is In" report when the fire alarm rings). The issue we found was that the account being used to run the service did not have access to the printer. In our case, Timeware didn't bomb out, but nothing was printed. As soon as we gave permissions to the printer for the Timeware service, all was well. Now with regards to IIS, I'm not too sure. What I have half worked out ... http://docs.php.net/manual/en/ini.core.php#ini.fastcgi.impersonate is required to be set to 1. The ApplicationPool that your site(s) run under needs to be set to something which can print. -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!"