15

I have a project in PhpStorm. I press upload to ftp on root folder and all files are uploaded to server. Then I work on this project – lets say modifying one file. When I press upload to ftp now, I see all files are being uploaded again – but they are not modified after last upload.

I do not want to upload automatically nor on explicit save action. The setting overwrite up-to-date files in settings → deployment → options is NOT checked.

Sync with deployed is not a solution, because a project is huge ant comparing every file by content is a total waste of resources and time.

How to upload only modified files?

asked Jun 19, 2013 at 10:15
6
  • Have you tried Preserve file timestamps under Settings | Deployment | Options ? BTW -- why comparing "by content"? Have you tried compare by "timestamp and size" -- should be faster (although still slow if website is big and connection is slow). Commented Jun 19, 2013 at 10:32
  • If you are using VCS -- when pushing/committing modified files, there should be an option to deploy (upload) files to default server (I'm not 100% sure on this, since I do not use VCS myself -- just remember seeing this kind of thing). Commented Jun 19, 2013 at 10:34
  • Yes, I tried compare by timestamp and size. But it looks like despite this, files are compared by content. Maybe for purpose to quick react when drop-down changes from „compare by time" to „compare by content". And speed is the same (slow). No, I'm not using VCS. I'm simply developing website at localhost and when significant piece of code is done – uploading to production server. It is strange, that PhpStorm does not have such a simple feature. I „googled hard", but it looks like no solution. Maybe, I'll use 3rd party tools for uploads, but it is not comfort with such a fantastic PhpStorm. Commented Jun 19, 2013 at 13:53
  • Well .. using VCS should definitely be more useful here: IDE has changelists which is excellent tool to track modified files. I was thinking: you can use Local History functionality to see what files you have modified since certain period of time (very good to see list of such modified files/folders) .. but unfortunately there is no "Upload" button there (and I DO WANT IT THERE MYSELF). I know that there is a ticket for this .. but I cannot find it right now. Commented Jun 21, 2013 at 9:52
  • In any case: FTP (or better say: deployment in general) is not top priority for PhpStorm devs (it has been mentioned quite few times) so all new features are taking time to be implemented. One of the "reasons" behind: modern devs should use VCS .. and VCS is capable of doing deployment (commit locally .. and checkout on remote server -- may not be so straightforward as using FTP and alike, but definitely working solution). P.S. I myself still do not use VCS, I use (S)FTP and facing the same problems (I just remember what files were modified .. or use sync, since projects are rather small) Commented Jun 21, 2013 at 9:56

5 Answers 5

10

Go to File> Settings, on Project Settings choose Deployment. Add a FTP server and mark it as default. Click OK to close the dialog window.

Now go to Tools> Deployment> Options. Choose the action trigger where you see: Upload changed files automatically to the default server

I hope it helps!

http://www.jetbrains.com/phpstorm/webhelp/uploading-and-downloading-files.html#automaticUploadOnUpdate

answered Sep 13, 2014 at 22:19
Sign up to request clarification or add additional context in comments.

2 Comments

This is not a solution. Because after you save file you go testing. And only after a number of cycles of coding and testing you want to upload modified files to server. It is nonsense to upload on every save. I chose a git-ftp solution.
@MaugLee I know a hell of a lot of water has flowed under the bridge, but for newcomers, the Deploy for Commits plugin might come in handy.
4

commit your project using PHPStorm (Ctrl+K)

it will open a window with lots of options to ease you the committing

also, there is "After Commit" tab, there you can choose from default servers you previously configured (Tool> Deployment) to upload files to

this way with the help of VCS only changed files will be uploaded to your server

answered Mar 27, 2019 at 21:12

Comments

1

First of all, I don't recommend using FTP for projects where security required. (By FTP connections password and data travels in a non-encrypted format, so it can be stolen easily. The only exception when the uploaded files (probably packages) are signed and the digital signature is checked on the server before doing anything with them. Afaik. PHAR is the default lib for that, but it is relative easy to encrypt and sign any zip file, if you put the signature into the file name. Don't confuse digital signature with md5 or sha1 hash.)

By simple projects with FTP I use git-ftp.

Installation (by windows, but I think it works every system as well)

git bash
$ cd ~
$ git clone https://github.com/git-ftp/git-ftp git-ftp.git
$ cd git-ftp.git && chmod +x git-ftp
$ cp ~/git-ftp.git/git-ftp /bin/git-ftp

Configuration

.git/config
 [git-ftp "myscope"]
 url = ftp.domain.com/subdir
 user = user
 password = pass

Initialization

git-ftp catchup -s myscope //by this the FTP and the local copy must be in perfect sync

Upload

git ftp push -s myscope

You have to use a .git-ftp-ignore file to define what you don't want to upload.

I usually use git-ftp with git merge and commit hooks.

.git/hooks/post-commit
.git/hooks/post-merge
 #!/bin/sh
 branch=`git rev-parse --abbrev-ref HEAD`
 if [ $branch == "master" ]; then
 git ftp push -s myscope
 fi

With those git-ftp automagically uploads by any changes of the master branch. Ofc I use master branch for releases only, for development I use another branches...

answered Feb 3, 2014 at 4:04

Comments

1

Best Practice Conventions: PHPStorm is designed around what is commonly considered "Best Practice". With that in mind many aspects of the deployment are best taken advantage of by having a version control system in place. When you commit via PHPStorm the commit dialog provides options to explicitly deploy the files in the changelist to a specific server (defaults are configurable)

Alternative 1: There is an option to "Sync with Deployed to yourhost" which can be used to compare your remote server files with your local files. "Project Pane"->(right click folder or file)->Deployment->"Sync with Deployed to ..."

This option launches a diff application which compares your selected file/folders and hints at what action should be taken (i.e. sync direction to/from deployment server)

I've only use this feature on target file sets as it has performance issues with large sets of files (e.g. the entire project in my case).

Alternative 2: For small file sets. Turn on automatic deployment temporarily with the "Explicit Save" option and then resave your files.

answered Aug 8, 2013 at 16:25

6 Comments

So what if you do not want to deploy after each and every commit but rather deploy only the changes, after several commits? Say if you're working on a new feature with a branch? Can you somehow upload all changed files when merging back into master?
- if you have version control integration enabled then your changed files will be placed in a change list.
I'm assuming you have a remote server already configured. - Settings->Deployment->Options["Upload external changes"]="Never" - If you have version control integration enabled -- View->"Tool Windows"->Changes -- Right click the change list and select the "Upload to <server>" - Else (VCS disabled) manually upload the changed files via Right click "Upload to <server>"
@LanceCaraccioli I do not have an option "Upload to server" in the changes window. Is this still working in PHPStorm 7.1.3?
I have 7.1.3. I'm using p4 CVS integration. I right click the change list and the last section of the context menu contains "upload to <default server name>". Of course this requires you to have a deployment server configured. Perhaps it has to be selected as the default server as well.
|
0

With Automatic Uploads checked ON, it is uploading files automatically even before I'm done making all changes to the PHP files and before I even click SAVE button and resulting in INCOMPLETE script files. It is also uploading files in other tab pages. Looks like there is no precise control on uploads in PhpStorm.

answered Jan 9, 2016 at 19:17

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.