jump to navigation

Zend Studio CVS over SSH integration June 5, 2005

Posted by Burhan in : Install Guides, Tutorials , trackback

I’m a long time user of Zend’s excellent Studio IDE product, and especially with their new version 4.0 — it really is a must have for anyone wanting to do any serious PHP development work.

4.0 introduces a lot of neat features (you can read about them at the official what’s new page). One feature is that it allows for CVS integration to allow teams of developers to work collaboratively.

Anyone who works with CVS knows that the best way to connect to a CVS server remotely is via SSH. Zend Studio 4.0 supports CVS-over-SSH, however, the official KB article did not work for me, and after several support tickets, the problem still remained unresolved — until I resolved it myself.

So, to save anyone else the hassle of going through all that I went through, I’m going to highlight the steps that I’ve taken to connect successfully. Hopefully this will come in handy.

In my situation, Zend IDE (ZDE) was running on a Windows XP Pro computer, connected to CVS running on a Linux (Gentoo) server over a local network.

You have to follow the following steps in order to get CVS-over-SSH running. Before you do anything else, make sure CVS is running properly on your system. This How To will not cover CVS installation/configuration. There are plenty of resources on how to setup CVS.

  1. Download the following programs and save them to a location on your PC. For simplicity, make sure the directory doesn’t have any spaces. I typically put these programs in C:\putty. You can download them all from the official putty download page.
    • PuTTY
    • Puttygen
    • Pagent
    • Plink
  2. Use puttygen to generate a public and private key pair for your machine. Do not give the key a passphrase. Copy the public key to the clipboard from the “Public key for pasting into authorized_keys” box by highlighting it with your mouse, then hit CTRL+C to copy it to the clipboard. You must save the private key to a file; you may also choose to save the public key for future reference.
  3. Install the public key at your CVS server by following these instructions:
    • Login to your CVS server using PuTTY (or your favorite SSH client)
    • Open (or create) a file called ~/.ssh/authorized_keys
    • Paste the contents of your clipboard to this file as one line. It is important that the entire key is in one line. When you copy it from the “Public key for pasting into authorized_keys” box, it is already formatted properly.
    • Save and close this file.
    • (Optional) You may want to make sure the authorized_keys file is not world writeable or group writeable. chmod go-w $HOME/.ssh/authorized_keys should take care of this.
  4. Back on your Windows box, run the program pagent. When it first runs, it will show up as an icon in your system tray. Right click on this icon and click Add Key. Locate the private key file from step 2 and load it into pagent.
  5. In Zend Studio, go to Tools –> Preferences. Click on the CVS tab.
  6. In the CVS_RSH key, put the full path to the plink program. In this example, it is C:\putty\plink.exe Click Apply, then OK to dismiss the Preferences window.
  7. Go to Tools –> CVS –> checkout
  8. In CVS Root, type :ext:username@hostname:/path/to/repository replacing the necessary parts with your details.
  9. Type the name of the module you want to check out.
  10. Give the local location where you want the files to be check out to.

If you have just setup a CVS server and want to check connectivity, you can checkout the CVSROOT module, from the default repository path.

That’s all there is to it! Now you can have CVS over SSH for Zend Studio (and any other CVS-enabled client).

I’ve already updated Zend with this information, so they should update their KB with these instructions. However, as of the publishing date of this piece, they have not.

Comments»

1. Rakesh - July 26, 2005

Hi:

The instruction that you have given were perfect… atleast I could make a connection to the cvs server. However, it still does not do anything though. I dont get any kind of a message other than the one in my CVS output window that says “C:\Program Files\Zend\ZendStudioClient-4.0.2\bin\cvs.exe -d :ext:codepush@agdev01.traderonline.com:/www/cvs/repository checkout autoextra”. I have looked at the working directory and there is nothing in that either. Please advice.

Thanks,
Rakesh.

2. Burhan - July 26, 2005

Are you able to checkout the module outside of Zend? By using another CVS client?

3. Rakesh - July 26, 2005

Hi Burhan:

Yes, currently my workingarea and cvs repository sit on the same machine but have different document roots. So, techincally I use putty to checkout the files to this seperate path.

Rakesh.

4. Rakesh - July 28, 2005

Any thoughts yet ?? Thanks a lot for your help in advance… Rakesh