php-windows Digest 14 Jun 2005 13:11:03 -0000 Issue 2694

Topics (messages 26094 through 26096):

Re: Extension
        26094 by: Frank M. Kromann

Re: MySQL Support
        26095 by: Paul Menard

Extension php_ssh2.dll: function ssh2_exec, stream returns only 65536 bytes
        26096 by: mmarsian.web.de

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 ---
Hi Brian,

IIS uses script mapping to tell the server how files are handled. When you
configured IIS to handle .php files you created (or the installer did) a
script map that tells the server that all .php files should be passed
through php-cgi.exe or php5isapi.dll.

If you do the same for html files (and that's most likely done on your
apache server as well) you can get IIS to handle php tags in these files
too.

- Frank

> Good morning,
> 
>  
> 
> I seem to have PHP working with IIS reasonably well, I have a .php file
> with <? Phpinfo(); ?> in it and life is good.  If I put that same line
> in an HTML file the server doesn't know what to do with it.  On Unix
> with Apache and PHP I can put PHP directives in .htm[l] files and it
> works.  Anyone know how to do this on IIS???
> 
>  
> 
> -brian
> 
>  
> 
> Brian D. McGrew { [EMAIL PROTECTED] || [EMAIL PROTECTED] }
> 
> ---
> 
> > YOU!  Off my planet!
> 
>  
> 
> 

--- End Message ---
--- Begin Message ---
What version of PHP and MySQL. For a long time PHP comes with MySQL support 
compiled in
(especially on Windows).

P

--- "Brian D. McGrew" <[EMAIL PROTECTED]> wrote:

> I installed a pretty general manual installation of PHP and it's
> working, I do a phpinfo() and life is good.  I can't seem to get it to
> connect to MySQL though.  I read something about the extensions and PEAR
> and all that.  I've got the libraries in my Windows directory and all
> that but when I do a phpinfo() I get no references to MySQL and I can't
> connect to the database.  MySQL is installed locally on the box.
> 
>  
> 
> Any ideas?
> 
>  
> 
> -brian
> 
>  
> 
> Brian D. McGrew { [EMAIL PROTECTED] || [EMAIL PROTECTED] }
> 
> ---
> 
> > YOU!  Off my planet!
> 
>  
> 
> 

--- End Message ---
--- Begin Message ---
Hi All,

i'm using the PHP Version 5.0.4 with Apache 2.0.54 on Windows XP SP2 and the 
latest Extension Module php_ssh2.dll.
I'm making a ssh2 connection to a SuSE 9.1 linux box with sshd version 
OpenSSH_3.8p1.

1. and most important:

if i use the ssh2_exec() function and read the returned stream, i get only the 
first 65536 bytes of the commands output.
How can i change this?

2. and less important:

if I use the compression setting "zlib" in the server_to_server direction the 
output is garbled. Am I doing something wrong or should I not use it?


Example code here:

<?php

function my_ssh_disconnect($reason, $message, $language) {
  printf("Server disconnected with reason code [%d] and message: %s\n",
         $reason, $message);
}

$methods = array(
  'kex' => 'diffie-hellman-group1-sha1',
  'client_to_server' => array(
   'crypt' => 'aes256-cbc',
   'comp' => 'none',
   'mac' => 'hmac-sha1'),
  'server_to_client' => array(
   'crypt' => 'aes256-cbc',
   'comp' => 'none',
   'mac' => 'hmac-sha1'));

$callbacks = array('disconnect' => 'my_ssh_disconnect');
$ssh_host = "gate01";
$connection = ssh2_connect($ssh_host, 22, $methods, $callbacks);
if (!$connection) die('Connection failed');
echo "Connected with $ssh_host<br>\n";

$fingerprint = ssh2_fingerprint($connection,
               SSH2_FINGERPRINT_MD5 | SSH2_FINGERPRINT_HEX);
echo "This host's Fingerprint is: $fingerprint\n<br>";

$user_name = "root";
if (ssh2_auth_pubkey_file($connection, 
$user_name,'C:\ProxyMgR\Keys\testkey.pub',
                         'C:\ProxyMgR\Keys\testkey', 'password')) {
  echo "Public Key Authentication Successful as user: $user_name<br>\n";
} else {
  die('Public Key Authentication Failed');
}

$ssh_command = "cat /etc/squid/squid.conf";  //                                
<------------------ the file is longer than 65535 bytes
echo "Executing Command: $ssh_command<br>\n";
echo "<pre>";
$stream = ssh2_exec($connection, $ssh_command);             
stream_set_blocking( $stream, true );

while ( $inhalt = fread( $stream, 8192 )) {  //                                 
     <------------------- the loop only returns 65536 bytes
  echo "$inhalt";
}
echo "</pre>";
?>
_________________________________________________________________________
Mit der Gruppen-SMS von WEB.DE FreeMail k�nnen Sie eine SMS an alle 
Freunde gleichzeitig schicken: http://freemail.web.de/features/?mc=021179

--- End Message ---

Reply via email to