You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered a "General Error" when using Windows and executing a command. After investigating, I came across PR #64 and experimented with a few tweaks to resolve the issue. Here's what worked for me:
The Issue
The << syntax doesn't work in the Windows Command Shell. However, you can use double quotes (") instead.
The Solution
I extended the SSH class in my project and made the following changes:
To ensure compatibility, I added a flag in my project that uses this custom SSH class if the application is running on a Windows machine.
You might wonder: "Why not open a PR to fix this issue?" Unfortunately, I don’t currently have the time to contribute a proper fix with tests. Since this solution was developed for my hobby project, I didn’t prioritize making it a formal PR. Besides, I suspect there aren't many Windows users in the PHP community who would encounter this issue.
I hope this helps someone facing a similar problem. If you have suggestions or improvements, feel free to share. Thanks!
The text was updated successfully, but these errors were encountered:
I encountered a "General Error" when using Windows and executing a command. After investigating, I came across PR #64 and experimented with a few tweaks to resolve the issue. Here's what worked for me:
The Issue
The
<<
syntax doesn't work in the Windows Command Shell. However, you can use double quotes ("
) instead.The Solution
I extended the
SSH
class in my project and made the following changes:Key Changes
EOF
part and replaced it with double quotes around the commands.&&
between commands to ensure they run sequentially on the server.Example Usage
Here’s how I use the modified class:
Example Output
Additional Notes
To ensure compatibility, I added a flag in my project that uses this custom SSH class if the application is running on a Windows machine.
You might wonder: "Why not open a PR to fix this issue?" Unfortunately, I don’t currently have the time to contribute a proper fix with tests. Since this solution was developed for my hobby project, I didn’t prioritize making it a formal PR. Besides, I suspect there aren't many Windows users in the PHP community who would encounter this issue.
I hope this helps someone facing a similar problem. If you have suggestions or improvements, feel free to share. Thanks!
The text was updated successfully, but these errors were encountered: