{"id":42399785,"url":"https://github.com/lodev09/php-ssh2","last_synced_at":"2026-01-28T01:14:23.603Z","repository":{"id":62518684,"uuid":"151767197","full_name":"lodev09/php-ssh2","owner":"lodev09","description":"Wrapper class for PHP's SSH2 extension.","archived":false,"fork":false,"pushed_at":"2022-02-16T18:31:43.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-04T16:45:22.802Z","etag":null,"topics":["php-library","php-ssh2","scp","ssh2"],"latest_commit_sha":null,"homepage":"https://github.com/lodev09/php-ssh2","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lodev09.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-05T19:16:29.000Z","updated_at":"2025-03-17T08:25:14.000Z","dependencies_parsed_at":"2022-11-02T13:45:41.734Z","dependency_job_id":null,"html_url":"https://github.com/lodev09/php-ssh2","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/lodev09/php-ssh2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lodev09%2Fphp-ssh2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lodev09%2Fphp-ssh2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lodev09%2Fphp-ssh2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lodev09%2Fphp-ssh2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lodev09","download_url":"https://codeload.github.com/lodev09/php-ssh2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lodev09%2Fphp-ssh2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28831241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T23:29:49.665Z","status":"ssl_error","status_checked_at":"2026-01-27T23:25:58.379Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php-library","php-ssh2","scp","ssh2"],"created_at":"2026-01-28T01:14:22.792Z","updated_at":"2026-01-28T01:14:23.595Z","avatar_url":"https://github.com/lodev09.png","language":"PHP","readme":"PHP SSH2\n============================\n\nWrapper class for PHP's [SSH2 extension](http://php.net/manual/en/book.ssh2.php). The base class was created by [Jamie Munro](https://www.sitepoint.com/author/jmunro/) taken from [this article](https://www.sitepoint.com/using-ssh-and-sftp-with-php/).\n\n## Installation\n```term\n$ composer require lodev09/php-ssh2\n```\n\n## Usage\n```php\n\n// connect\n$auth = new \\SSH2\\Password(SFTP_USER, SFTP_PASSWORD);\n$sftp = new \\SSH2\\SFTP(SFTP_HOST, $auth);\n\nif ($sftp-\u003eis_connected() \u0026\u0026 $sftp-\u003eis_authenticated()) {\n    // upload\n    $sftp-\u003eput('/path/to/my/local/file', '/remote/file');\n\n    // download\n    $sftp-\u003eget('/remote/file', '/local/destination/file');\n}\n```\n\n### SFTP\nCommon helper methods includes:\n- `SFTP::mv` - move remote file\n- `SFTP::rm` - delete remote file\n- `SFTP::list` - list remote files\n- `SFTP::is_dir` - check if path is a directory\n- `SFTP::exists` - check if path exists\n\nOther native methods can be called as well for example:\n```php\n// ssh2_sftp_mkdir\n$sftp-\u003emkdir(...);\n```\n\n### SCP\nJust a pure wrapper of the native `ssh2_scp_xxx` functions.\n```php\n// ssh2_scp_recv\n$scp-\u003erecv(...);\n```\n\n## Feedback\nAll bugs, feature requests, pull requests, feedback, etc., are welcome. Visit my site at [www.lodev09.com](http://www.lodev09.com \"www.lodev09.com\") or email me at [lodev09@gmail.com](mailto:lodev09@gmail.com)\n\n## Credits\n- [Jamie Munro](https://www.sitepoint.com/author/jmunro/)\n- Jovanni Lo [@lodev09](http://twitter.com/lodev09)\n\n## License\nReleased under the [MIT License](http://opensource.org/licenses/MIT).\nSee [LICENSE](LICENSE) file.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flodev09%2Fphp-ssh2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flodev09%2Fphp-ssh2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flodev09%2Fphp-ssh2/lists"}