Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call to undefined function ssh2_connect()

Tags:

php

$connection = ssh2_connect($SFTP_SERVER, 22);
ssh2_auth_password($connection,$SFTP_USERNAME,$SFTP_PASSWORD);
$sftp = ssh2_sftp($connection);

Fatal error: Call to undefined function ssh2_connect() in /var/www/html/beta/0sftp.php on line 33

my system is CentOS 6.4 all the required extensions is installed but I don't know how to verify.

like image 847
user2807431 Avatar asked Sep 24 '13 10:09

user2807431


2 Answers

try to run the command :

yum install php-pecl-ssh2

like image 64
Moshe Zino Avatar answered Sep 16 '22 19:09

Moshe Zino


For whatever it is worth, I tested the installation from the command line

php -i | grep ssh

and it was OK, but it did not work in a web page; took me a couple of minutes to remember I have to re-start Apache after installation :)

like image 34
JP Dippenaar Avatar answered Sep 16 '22 19:09

JP Dippenaar