kaf3773 Posted January 28, 2013 Share Posted January 28, 2013 Hello All, I installed php5 from OpenCSW but i believe it does not support the expect module. I tried to run a php script to call expect to do a telnet to a device but i got this error PHP Warning: fopen(): Unable to find the wrapper "expect" - did you forget to enable it when you configured PHP? in /export/home/php_expect.php on line 5 I will appreciate very much if you can help me configure the expect wrapper into php. here is the script i was trying to use to test <?php ini_set("expect.loguser", "Off"); $stream = fopen("expect://ssh root@remotehost uptime", "r"); $cases = array ( array (0 => "password:", 1 => PASSWORD) ); switch (expect_expectl ($stream, $cases)) { case PASSWORD: fwrite ($stream, "password\n"); break; default: die ("Error was occurred while connecting to the remote host!\n"); } while ($line = fgets($stream)) { print $line; } fclose ($stream); ?> Thanks Quote Link to comment https://forums.phpfreaks.com/topic/273758-php-support-for-expect-in-solaris/ Share on other sites More sharing options...
trq Posted January 29, 2013 Share Posted January 29, 2013 I will appreciate very much if you can help me configure the expect wrapper into php. Where exactly are you stuck? Quote Link to comment https://forums.phpfreaks.com/topic/273758-php-support-for-expect-in-solaris/#findComment-1408885 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.