This solution is applicable to any Vagrant configuration for Magento instance, several tweaks should be done:
Set up synchronization in vagrant config file only for those directories, which require guest-to-host synchronization (can be of any type, even default). Recommended directories are already configured in Vagrant config:
Vagrant.configure(2) do |config|
config.vm.synced_folder '../magento2ce/var/generation', '/var/www/magento2ce/var/generation'
config.vm.synced_folder '../magento2ce/app/etc', '/var/www/magento2ce/app/etc'
end
Open your project on host machine in PhpStorm and set up deployment configuration, which will upload to the guest machine everything except for those folders which are synchronized by Vagrant.
Go to Tools -> Deployment -> Configuration
Add new SFTP server and mark it as default when added (using button in top left corner)
Fill out connection settings using the information taken from vagrant ssh config
Go to the 'vagrant-magento' directory (contains your vagrant project) in console and execute 'vagrant ssh-config'
Use private key Auth type instead of password
Set up mapping between your local and remote versions of the project, for remote project use '/var/www/magento2ce'
Add remote paths excluded from synchronization by PhpStorm. You should add those paths which are specified in Vagrant config for synchronization.
Go to Tools -> Deployment -> Options... and enable automatic upload to default server and check "Upload external changes"
You can upload full Magento code base to the virtual machine from the host machine using context menu on the root of the project in PhpStorm.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。