Is Apache Server Installed? for example: xampp?
If you do this, you use the FTP function:
<?php $connection = ssh2_connect('ftp.server.com', 22); //port 22 for Shell connections ssh2_auth_password($connection, 'username', 'password'); $shell_ftp = ssh2_sftp($connection); $connectionStream = fopen('ssh2.sftp://'.$shell_ftp.'/path/to/fileorfolder', 'r'); if(!connectionStream) { echo "Could not connect to the server, please try agian"; } else { echo "Successfully logged in."; } ?>
To establish a basic connection to the Shell server, you must specify the absolute path to the file or folders.
source share