Because my NetBeans is on the host while the development environment is in the guest, I need to treat Yii Framework in TurnKey Linux in virtual machine as a remote server. Here is how to make them work together.
Create a Project with Remote Server
Launch wizard from [File]→[New Project…] in your NetBeans.
Step 1, choose [PHP Application from Remote Server].
Step 3, use the virtual machine IP address as url. You will need to manually create a new [Remote Connection] by pressing [Manage] to add a new one. TurnKey Linux has build-in SFTP service enabled. Test connection before apply. If you are using building web application, change [Upload Directory] to yiiframework. Make sure the generated SFTP command access the right directory.
Step 4, choose files and folders to be included in project.
Work with Save
Every time you save a file in the project, NetBeans will upload automatically to replace the old version file on server.
About last file properties, it will use virtual machine date information and the account used in remote connection. You may follow Setup Time Zone and Sync with a NTP Server in TurnKey Linux to make sure your host and guest environment are on the same time zone.
On the [Source Files] in Projects windows, right click to [Synchronize…]. It will compare files on both sides and show your a list with suggestion. Double click on any of them will bring you file contents and compare side by side.
Without Setup Time Zone and Sync with a NTP Server in TurnKey Linux, you might always upload or download from virtual machine. If you have open files in NetBeans, I suggest you to [Save All] before syncing or there would be conflicts need to be solved manually.
Please be very careful when you want to sync between host and guest. I still preferred to close all open files and make a copy of the directory in host before synchronization.
In Oracle: NetBeans for PHP: Blogs: Remote synchronization, Thomas writes:
Please notice that the remote synchronization works better only on the whole project (it means that the Source Files must be selected). The Synchronize action is also available on individual files (more files can be selected at once) but the suggested operation (download, upload etc.) does not work so precisely. Also please notice that the suggested operations are not 100% reliable since the timestamps provided by FTP servers are not exact.
- NetBeans: Docs & Support: Deploying a PHP Application on a Remote Web Server Using the NetBeans IDE
- Oracle: NetBeans for PHP: Blogs: Remote synchronization
- Setup Time Zone and Sync with a NTP Server in TurnKey Linux
- TurnKey Linux
- TurnKey Linux: Yii Framework
- Wiki: IP address
- Wiki: SSH File Transfer Protocol
- Wiki: Uniform resource locator
- Wiki: Virtual machine
- Yii Framework