Comments (1)
Never mind, I checked the source code and I saw that since version 0.13 this can be already done:
$connection = ssh2_connect($host);
ssh2_auth_password($connection, $username, $password);
$channel = ssh2_exec($connection, $command);
$metadata = stream_get_meta_data($channel);
$exitCode = $metadata['exit_status'];
fclose($channel);
from pecl-networking-ssh2.
Related Issues (12)
- Compatibility with PHP 8.1 windows dll HOT 1
- ssh2_auth_password Password parameter does not work as expected HOT 4
- ssh2_auth_pubkey_file caused "segmentation fault" when enable xdebug HOT 1
- ssh2_exec execution stops after 32kb of data
- PHP 7.4 Comatibility HOT 2
- Cannot specify timeout HOT 1
- Modern SSH hostkey methods compatibility HOT 5
- ssh2 php8.2 for windows (.dll file) HOT 1
- Version 1.4 missing on PECL HOT 3
- ssh2_scp_send() truncates files, incomplete file saved on remote server
- SSH2 fails after upgrading to PHP8.2 and Debian Bookworm - ssh2_auth_pubkey_file(): Authentication failed HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pecl-networking-ssh2.