PHP fatal error:call to undefined function ssh2_connect () Proble
m!!!
In the Win7 under the mysql+apache+php environment, now want to use PHP via SSH to execute commands on the remote server, refer to the online tutorial in php.ini to add Extension=php_ssh2.dll, and Php_ Ssh2.dll put Ext,extension_dir configuration no problem, but error: Fatal error:call to undefined function ssh2_connect () in D:\phpweb\ssh2\ Ssh.php on line 2 look at you expert pointing twos.
PHP.ini in the Extensions section:
; Extension=php_bz2.dll
Extension=php_curl.dll
Extension=php_dba.dll
Extension=php_dbase.dll
; Extension=php_exif.dll
; Extension=php_fdf.dll
Extension=php_gd2.dll
; Extension=php_gettext.dll
; Extension=php_gmp.dll
; Extension=php_ifx.dll
; Extension=php_imap.dll
; Extension=php_interbase.dll
Extension=php_ldap.dll
; Extension=php_mbstring.dll
; Extension=php_mcrypt.dll
Extension=php_mhash.dll
Extension=php_mime_magic.dll
Extension=php_ming.dll
Extension=php_msql.dll
Extension=php_mssql.dll
Extension=php_mysql.dll
Extension=php_mysqli.dll
; Extension=php_oci8.dll
Extension=php_openssl.dll
; Extension=php_pdo.dll
; Extension=php_pdo_firebird.dll
Extension=php_pdo_mssql.dll
Extension=php_pdo_mysql.dll
; Extension=php_pdo_oci.dll
; Extension=php_pdo_oci8.dll
; Extension=php_pdo_odbc.dll
; Extension=php_pdo_pgsql.dll
; Extension=php_pdo_sqlite.dll
Extension=php_pgsql.dll
; Extension=php_pspell.dll
Extension=php_shmop.dll
; Extension=php_snmp.dll
; Extension=php_soap.dll
Extension=php_sockets.dll
; Extension=php_sqlite.dll
; Extension=php_sybase_ct.dll
Extension=php_tidy.dll
Extension=php_xmlrpc.dll
Extension=php_xsl.dll
; Extension=php_zip.dll
Extension=php_ssh2.dll
The PHP code is as follows:
PHP Code
<!--?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username','password');
¥stream=ssh2_exec($connection, 'usr/local/bin/php -i');
?-->
------Solution--------------------
Is your host configured to shell.example.com this domain name
------Solution--------------------
discuss
Is your host configured to shell.example.com this domain name