php-windows Digest 20 Apr 2005 07:24:53 -0000 Issue 2639

Topics (messages 25869 through 25882):

Re: Call to undefined function printer_open()
        25869 by: Nick
        25870 by: Nick
        25871 by: Nick
        25872 by: Nick
        25873 by: Nick
        25874 by: JC Botha
        25877 by: Nick
        25878 by: Darvin Andrioli
        25879 by: Nick

PHP Files won't parse
        25875 by: Brett Patterson

R: [PHP-WIN] Call to undefined function printer_open()
        25876 by: Darvin Andrioli

saving word files
        25880 by: Nick
        25881 by: Nick

Jaw Breaker - What's the ansewer?
        25882 by: JC Botha

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
i have tried in as an netwerk printer and local printer, both doesnt work
:s:s
 yeah i have libmysql.dll, and al my database operations work fine, just not
that printer_open function

this is what i did
----------------
-installed Apache HTTP Server (apache_1.3.31-win32-x86-no_src.exe and on
other pc apache_2.0.54-win32-x86-no_ssl.msi), just to test
-changed port  to http://localhost:8080/
-installed mysql-4.0.20d-win.zip
- did mysqld-nt.exe --install in console, and started the whole thing
-installed php-5.0.1-Win32.zip
-added in httpd.conf
# associeer .php - bestanden met PHP

AddType application/x-httpd -php .php

# laad PHP binnen in Apache als module

LoadModule php5_module "c:/php/php5apache.dll"

content of php.ini
; Directory in which the loadable extensions ( modules ) reside .

extension_dir = "c:\php\ext"

did extension = php_mysql .dll and extension = php_printer.dll (downloaded
from http://snaps.php.net/win32/PECL_5_0/, and placed in c:\php\ext)

copied libmysql.dll to C:\Windows\system32

And i have no idea why he wont load php_printer.dll


"Jin Yong Wu" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Check whether you install related printer driver. For instance, it's not
> enough only to load
> module <php_mysql.dll>, but also you should have libmysql.dll. Maybe it'll
> help you some.
>
> Yong
>
> -----Original Message-----
> From: Nick [mailto:[EMAIL PROTECTED]
> Sent: Monday, April 18, 2005 23:07 PM
> To: [email protected]
> Subject: [PHP-WIN] Call to undefined function printer_open()
>
>
> hey
>
> i want to use that function, but i cant load it :s
>
> content of php.ini:
> ;extension=php_pgsql.dll
> extension=php_printer.dll
> ;extension=php_shmop.dll
>
> extension_dir = "c:\php\ext"
>
> the file is =>> C:\php\ext\php_printer.dll
>
> this seems correct to me. why wont it load
>
> some more info: i use apache(apache_1.3.31-win32-x86-no_src.exe), win xp
> pro, mysql (mysql-4.0.20d-win.zip), php 5.0.1 (php-5.0.1-Win32.zip)
>
> this didnt work ==> multithreaded
> // Example loading an extension based on OS
> if (!extension_loaded('printer')) {
>    if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
>        dl('php_printer.dll');
>    } else {
>        dl('printer.so');
>    }
> }
>
>       System  Windows NT PCNICK 5.1 build 2600
>       Build Date  Aug 12 2004 23:30:01
>       Configure Command  cscript /nologo configure.js "--with-gd=shared"
> "--enable-snapshot-build"
>       Server API  Apache
>       Virtual Directory Support  enabled
>       Configuration File (php.ini) Path  C:\WINDOWS\php.ini
>       PHP API  20031224
>       PHP Extension  20040412
>       Zend Extension  220040412
>       Debug Build  no
>       Thread Safety  enabled
>       IPv6 Support  enabled
>       Registered PHP Streams  php, file, http, ftp, compress.zlib
>       Registered Stream Socket Transports  tcp, udp
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
also added c:\php\ext and c:\php\ext\ to windows %path% environment
variable, saw in other thread
did not work :s

"Jin Yong Wu" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Check whether you install related printer driver. For instance, it's not
> enough only to load
> module <php_mysql.dll>, but also you should have libmysql.dll. Maybe it'll
> help you some.
>
> Yong
>
> -----Original Message-----
> From: Nick [mailto:[EMAIL PROTECTED]
> Sent: Monday, April 18, 2005 23:07 PM
> To: [email protected]
> Subject: [PHP-WIN] Call to undefined function printer_open()
>
>
> hey
>
> i want to use that function, but i cant load it :s
>
> content of php.ini:
> ;extension=php_pgsql.dll
> extension=php_printer.dll
> ;extension=php_shmop.dll
>
> extension_dir = "c:\php\ext"
>
> the file is =>> C:\php\ext\php_printer.dll
>
> this seems correct to me. why wont it load
>
> some more info: i use apache(apache_1.3.31-win32-x86-no_src.exe), win xp
> pro, mysql (mysql-4.0.20d-win.zip), php 5.0.1 (php-5.0.1-Win32.zip)
>
> this didnt work ==> multithreaded
> // Example loading an extension based on OS
> if (!extension_loaded('printer')) {
>    if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
>        dl('php_printer.dll');
>    } else {
>        dl('printer.so');
>    }
> }
>
>       System  Windows NT PCNICK 5.1 build 2600
>       Build Date  Aug 12 2004 23:30:01
>       Configure Command  cscript /nologo configure.js "--with-gd=shared"
> "--enable-snapshot-build"
>       Server API  Apache
>       Virtual Directory Support  enabled
>       Configuration File (php.ini) Path  C:\WINDOWS\php.ini
>       PHP API  20031224
>       PHP Extension  20040412
>       Zend Extension  220040412
>       Debug Build  no
>       Thread Safety  enabled
>       IPv6 Support  enabled
>       Registered PHP Streams  php, file, http, ftp, compress.zlib
>       Registered Stream Socket Transports  tcp, udp
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
ok i fixed it

i removed php 5.0.1 and installed 5.0.4 and it worked perfect?

now i need to print the file

can some one help me?

        $printer = "\\\\GLENN\\hp deskjet 990c";

        $file= $lening[$i]->briefVDABbestand; -> contains an word document
        $handle = printer_open($printerlocatie);
        printer_start_doc($handle, $bestand);
        printer_start_page($handle);

        printer_end_page($handle);
        printer_end_doc($handle);
        printer_close($handle);

this wont work :s:s

--- End Message ---
--- Begin Message ---
sry, error in code

>         $printer = "\\\\GLENN\\hp deskjet 990c";
>
>         $file= $lening[$i]->briefVDABbestand; -> contains an word document
path(ex letter.doc)
>         $handle = printer_open($printerlocatie);
>         printer_start_doc($handle, $file);
>         printer_start_page($handle);
>
>         printer_end_page($handle);
>         printer_end_doc($handle);
>         printer_close($handle);
>

--- End Message ---
--- Begin Message ---
on a network printer it dont seem to work, but on local he "starts"
printing, the paper goes in :)
but he prints nothing, just an empty page :s:s



"Nick" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> ok i fixed it
>
> i removed php 5.0.1 and installed 5.0.4 and it worked perfect?
>
> now i need to print the file
>
> can some one help me?
>
>         $printer = "\\\\GLENN\\hp deskjet 990c";
>
>         $file= $lening[$i]->briefVDABbestand; -> contains an word document
>         $handle = printer_open($printerlocatie);
>         printer_start_doc($handle, $bestand);
>         printer_start_page($handle);
>
>         printer_end_page($handle);
>         printer_end_doc($handle);
>         printer_close($handle);
>
> this wont work :s:s

--- End Message ---
--- Begin Message ---
Dear Users

What is the name for the precision floating point function(syntax).
Like having 2.987 to be 2.89?

Thanks

--- End Message ---
--- Begin Message ---
yeah, but thats only to print an single line, not a whole word file (MS
office word ;) )
the files that i use are like 5 to 10 pages. not very usefull that i draw
text i suppose

thanks anyway

"Darvin Andrioli" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Have a look at the example at
> http://it2.php.net/manual/en/function.printer-draw-text.php
> it may help you.
>
> Darvin
>

--- End Message ---
--- Begin Message ---
> -----Messaggio originale-----
> Da: Nick [mailto:[EMAIL PROTECTED]
> Inviato: marted� 19 aprile 2005 18.04
> A: [email protected]
> Oggetto: Re: [PHP-WIN] Call to undefined function printer_open()
>
>
> yeah, but thats only to print an single line, not a whole word file (MS
> office word ;) )
> the files that i use are like 5 to 10 pages. not very usefull that i draw
> text i suppose
Ops, I didn't understand your needs. Anyway, the printer extension can not
print word document. Probably, but I haven't any experience, you may try the
COM functions and ask the Word Document Object to print its own files.

Darvin

--- End Message ---
--- Begin Message ---
Ah thanks, i will try that.

"Darvin Andrioli" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> > -----Messaggio originale-----
> > Da: Nick [mailto:[EMAIL PROTECTED]
> > Inviato: marted� 19 aprile 2005 18.04
> > A: [email protected]
> > Oggetto: Re: [PHP-WIN] Call to undefined function printer_open()
> >
> >
> > yeah, but thats only to print an single line, not a whole word file (MS
> > office word ;) )
> > the files that i use are like 5 to 10 pages. not very usefull that i
draw
> > text i suppose
> Ops, I didn't understand your needs. Anyway, the printer extension can not
> print word document. Probably, but I haven't any experience, you may try
the
> COM functions and ask the Word Document Object to print its own files.
>
> Darvin

--- End Message ---
--- Begin Message ---
Hey guys.

I just set up Apache 2, PHP 5, and mySQL on my Windows XP Pro sp2 box.
 Everything works great.  If I run the phpinfo() I get everything back
as expected.

If I go to a page that I have created that is PHP and there's no
dynamic content, just a templated system, nothing renders.  I get the
basic html and body tags.  Nothing else.

Is this a problem with document root dealing with includes, or what?

If it is, I'd much rather find a way to do something where the "user"
is dependant upon what base folder I'm in in the htdocs directory. 
Not sure how to set it up though.

Any help would be greatly appreciated.

~Brett

--- End Message ---
--- Begin Message ---
Have a look at the example at
http://it2.php.net/manual/en/function.printer-draw-text.php
it may help you.

Darvin

> -----Messaggio originale-----
> Da: Nick [mailto:[EMAIL PROTECTED]
> Inviato: marted� 19 aprile 2005 15.04
> A: [email protected]
> Oggetto: Re: [PHP-WIN] Call to undefined function printer_open()
>
>
> on a network printer it dont seem to work, but on local he "starts"
> printing, the paper goes in :)
> but he prints nothing, just an empty page :s:s
>
>
>
> "Nick" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > ok i fixed it
> >
> > i removed php 5.0.1 and installed 5.0.4 and it worked perfect?
> >
> > now i need to print the file
> >
> > can some one help me?
> >
> >         $printer = "\\\\GLENN\\hp deskjet 990c";
> >
> >         $file= $lening[$i]->briefVDABbestand; -> contains an
> word document
> >         $handle = printer_open($printerlocatie);
> >         printer_start_doc($handle, $bestand);
> >         printer_start_page($handle);
> >
> >         printer_end_page($handle);
> >         printer_end_doc($handle);
> >         printer_close($handle);
> >
> > this wont work :s:s
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message ---
i need to print the word file, but first testing by saving

this seems not to work, site keeps loading :s:s:s nothing happens

<?php
$word = new COM("word.application") or die("Unable to instantiate Word");
$file = "c:/reminder.doc";
$word->Documents->Open($file);
$new_file = "c:/reminder_new.doc";
$word->Documents[1]->SaveAs($new_file);
$word->Quit();
$word->Release();
$word = null;
?>

this neither, also much loading time, nothing happens


// starting word
$word = new COM("word.application") or die("Unable to instanciate Word");
print "Loaded Word, version {$word->Version}\n";
// bring it to front
$word->Visible = true;
// Open a word document, or anything else that word can read
$input ="c:\\beginverslag.doc";
$word->Documents->Open($input);
$new_file = "c:\\test.doc";
$word->Documents[1]->SaveAs($new_file);
// closing word
$word->Documents[1]->Close(false);
$word->Quit();
// free the object
$word->Release();
$word = null;
unset($word);

any suggestions?????

--- End Message ---
--- Begin Message ---
Just a note to those wanting to use COM to interface to printers under Windows 
2000/XP.  If it doesn't work or seems to hang, try changing the logon identity 
under which the Apache (assuming you're using Apache) service is running from 
the System account to another account.  By default most services will install 
to run under the System account and although the System account has total 
authority on the computer it is running on, it has no authority outside of that 
realm as I understand it.  Apparently accessing printers is considered "outside 
the realm".  I used this technique to interface a Dymo thermal label printer to 
my server and it works now. 

i selected another account on my pc like "Nick", he is admin
i tried it, but always this error

Could not start the Apache service on Local Computer.

Error 1069: The service did not start due to a logon failure

any help?

"Nick" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> i need to print the word file, but first testing by saving
> 
> this seems not to work, site keeps loading :s:s:s nothing happens
> 
> <?php
> $word = new COM("word.application") or die("Unable to instantiate Word");
> $file = "c:/reminder.doc";
> $word->Documents->Open($file);
> $new_file = "c:/reminder_new.doc";
> $word->Documents[1]->SaveAs($new_file);
> $word->Quit();
> $word->Release();
> $word = null;
> ?>
> 
> this neither, also much loading time, nothing happens
> 
> 
> // starting word
> $word = new COM("word.application") or die("Unable to instanciate Word");
> print "Loaded Word, version {$word->Version}\n";
> // bring it to front
> $word->Visible = true;
> // Open a word document, or anything else that word can read
> $input ="c:\\beginverslag.doc";
> $word->Documents->Open($input);
> $new_file = "c:\\test.doc";
> $word->Documents[1]->SaveAs($new_file);
> // closing word
> $word->Documents[1]->Close(false);
> $word->Quit();
> // free the object
> $word->Release();
> $word = null;
> unset($word);
> 
> any suggestions?????

--- End Message ---
--- Begin Message ---
The following is a section of PHP code (see Apache.org and PHP.net).

  function f($c) {
    $c++;
    if ($c % 2) { return f($c); }
    return $c++;
  }
  
  function g($n) {  
    for ($i=1;$i<10;$i++) {
      $n = f($n*$i);
    }
    return ($n);
  }
    
  print(g($x));

What is the smallest value that $x can have if 4277108 is outputted to
the screen after running this code?
$x is a number between 1 and 10 and has 2 decimal places.

--- End Message ---

Reply via email to