Zend Studio offers the "Remote Servers" feature, which allows you to work on your project in Zend Studio normally, while synchronizing all your project files to your application container as you edit them, or if you prefer, upon request.
To set up Remote Servers support for your project with your Zend Developer Cloud application container as the remote server, follow these simple steps:
Add your application container's private access key to Zend Studio
- In Zend Studio, go to Window → Preferences (in Linux or Windows) or Zend Studio → Preferences (in Mac OS X). The Preferences dialog will appear
- Enter "SSH2" into the search box and select the General → Network Connections → SSH2 pane
- In the "General" tab, click on the "Add Private Key" button
- Locate your PEM encoded private key file which you have downloaded during container creation (or the private key file paired with the public key file which you have uploaded), and select it
- The path to your private key file will be added to the "Private Keys" field
- Click "Ok" to save your changes and close the dialog
- Open the PHP or Zend Framework project that you want to upload to your application container, or create a new project
Configure your project to use your application container as its Remote Server
- From the "Project" menu select "Properties". The Project Properties dialog will appear
- Enter "Remote Server" in the search box and select "Remote Server Support". The Remote Servers Support pane will appear
- Check the "Enable remote connection properties" checkbox (1)
- Click on the "Manage" button (2). The Remote Connection Profile management dialog will appear
If you have not created a remote connection profile, the "New Remote System Connection" dialog will appear. If you already have at least one remote connection set up, click on the "Add" button in the Remote Connection Profile dialog to add a new connection
Enter your container's host name (
<yourcontainer>.my.phpcloud.com) and select "SSH" as the system type. When done, click "Finish"
Type your container name in the Username field (1) and click "Test Connection" to verify your settings. If the connection is successful, click "Finish". The "New Remote System Connection" dialog will disappear
In the Remote Server Support properties pane's "Project Directory" field (1), enter the remote directory under which the project is to be deployed. This should be one of the following directories, depending on your project layout:
For a traditional PHP application that is designed to be deployed entirely onto the Web server's document root, enter
/<your container>/applications/<app name>/public
For a project that is designed to be deployed entirely outside the document root with the exception of specific files (as in the recommended Zend Framework project layout), enter
/<your container>/applications/<app name>. Ensure that your project's document root directory is named
'public', and is directly under the project's root directory
<your container>should be replaced with your container name.
- For a traditional PHP application that is designed to be deployed entirely onto the Web server's document root, enter
In the "Upload Files" drop-down menu (2), select how Zend Studio will upload files to your container:
- To automatically upload files as they are modified and saved, select "On Save"
- To automatically upload files as you run them or start a debug session, select "On Run"
- To never upload files automatically, select "Manually". In this mode files are uploaded to the container only if you choose to do so
- Click "Ok" to save your settings, the Project Properties dialog will disappear
- You will be asked whether you want to upload files to the server now - click "Yes" to synchronize your project to the server.
To manually synchronize your files to the server, right-click the project's root directory in the PHP Project Explorer pane, and select "Remote Servers" → "Upload To Server"
- The "Data Upload Selection" dialog will appear. You may choose to synchronize the entire project tree or parts of it to your server
- Click "Finish" to upload your files
- Your project is now accessible over the Web