Warum? - Oft benötigt man Zugriff auf den Server, um beispielsweise mal einfach eine Logdatei einfach nur mal zu lesen, darin zu navigieren. Auch das “einfache” Navigieren in den Ordnern eines Servers kann nervig sein. Und natürlich will man eventuell auch “schnell mal” eine Datei auf dem Server bearbeiten. - Das geht mit SFTP-Connection und offenbar recht elegant in PhpStorm.
(Voraussetzung dazu wären aber: Zugriffs- und Schreibrechte einer Datei oder Ordner auf dem Server)
Einrichtung
Step 1/2 - (NOTE Do the IMPORTANT CHECKS in "Step 2/2" too)
Open phpStorm/topMenu/Settings/Build, Execution, Deployment/Deployment click + select: SFTP
Enter new connection data
/tabelle
Connection name | z. B.: "anyspider.anykey.ch" |
Type | SFTP |
SSH-Configuration: Add New
Host | |
Port | 22 |
Username | <yopur-user-name> |
Authentification-Type | Password |
Passwort | ****** (enter your SSH-Passphrase) |
Test Connection
... Key Passsphrase for the file: /Users/stefan/.ssh/id_ed25519 eingeben aus 1Password
click NEXT
"successful"
check: Use rsync for download/upload/sync
(ungetestet ist, ob ich das eventuell nicht brauche)
Connection Parameters
... nothing is set ... i will try if this is needed
... evt Send keep-alive messegaes every ... seconds ... not set
Http/Soxks Proxy
... not set something
click Apply, click OK
#Step 2/2 - IMPORTANT CHECKS
Suche die Einstellungen
* "Upload changed files automatically to the default server"
(PhpStorm/Settings/Build, Execution, Deploy/Options)
"Never" !!! ... if you wont other, you have to be arware what you do !!!
* Preserve original file permissions
(what means, the permittions on you local machine !!! NOT on the server)
de-select means unCheck: "Override default permissions on files"
de-select means uncheck: "Override default permissions on folders"
* Warn when uploading over newer file
(for the first time, let it: "NO")
click "Apply"
click "OK"
Re-open the Setting and check you changes in the options, that they are saved
if ok than leave the settings an work
Usage
Open the Server-Side-Explorer-View
- open the remote server by sftp via rsync … open:
PhpStorm/topMenu/Tools/Deployment/Browse remote host
(It opens a pane on the right)
- if you see "No authentification data provided"
Try to reload: (click the reload symbol near top right the 2 round arrows)
- bottom right in black: there is a message info popup with:
"Enter your passphrase for SFTP/SSH" or the likely
enter your ssh-password to open connection
... now you should see the folders on the server
Download a file or view file content from server side
# to download a file or a folder, go with the mouse of what you need and
- Variant 2 - look into that file from server
(simply click on it, in the remote server pane)
- Variant 1 - download
click "copy" and on the left or your local side click "past" where you want, and it will downloaded from the server