One of the great functions of Eclipse IDE is that it can be tightly integrated to the any repository, which is very useful especially you want to share your codes with others and works on them together. Even, CVS is a very useful tool for your own since you can easily track the changes you make your source codes while you are developing your programs on Eclipse. Here, in this blog we try to set up a CVS system on Windows XP and we will explore the usage of it within different programs. Notice that in order to this we use the service provided by Freepository which is the perfect online CVS repository service that you can deploy your codes.
Requirements
First of all the instructions provided here is on Windows XP machine so I do not know whether it can be used in other operation systems but it should work if you apply some modifications whenever necessary for your system.
The programs that you should have during this process are Eclipse, TortoiseCVS. The versions of these programs that I have are:
TortoiseCVS 1.8.26 (CVSNT 2.5.03 Build 2260)
Eclipse 3.1.2
Also you need an account on Freepository. And you should have at least one installed repository. During this blog the name of the repository I have is "cvsroot". In order to use it for Eclipse or TortoiseCVS, we need to see the parameters of that repository. To do that, in the website of the Freepository, we select the repository "cvsroot" and then click "My cvsroot". If it is the first time, the server warns you that you should first create secure entries. Thus, you should click the link left to "My cvsroot" which is "Secure ID entries". Then you can click "My cvsroot". If everything goes well, then you can have a table as following which gives you the parameters you need to configure Eclipse or TortoiseCVS:
We will return these parameters later during the installation.
Installation Process
First of all, in order to use CVS function on Windows machine, we need to set up CVSNT. Since the installation of TortoiseCVS does this already, we do not need to install it separately.
Configuring TortoiseCVS
After installing TortoiseCVS and restarting the PC, we move on any folder in any directory in the file system and right click on the mouse.
Then select "CVS" > "Make new Module". The screen will look like as the following:
Here you should supply the following information:
Protocol : SSL(:sserver:)
Protocol parameters : version=1
Server : freepository.com
Port : the port number that you see in the table of parameters of your Freepository repository.
Repository folder : the information under "fq cvsroot" of the table above.
User name : your user name.
Module : if you already have a module, then write its name or write "." (without quotation marks).
When you click "OK", TortoiseCVS will attempt to connect to the Freepository Server and prompt for the password. Write your account password and get a connection to the repository. If everything goes successfully you will have a connection to the repository. Again in an any folder right click on an empty place and click to "CVS checkout" to see if everything works fine.
Configuring the Eclipse
Before configuring the Eclipse, we need to install CVS SSL plug-in for Eclipse. To download the version of that plug-in for the usage of Eclipse 3.1, click the link here:
http://home.arcor.de/rolf_wilms/cvsssl/rwi.eclipse.team.ccvs.ssl_3.1.0.zip
After downloading the plug-in, extract the context to the Eclipse's "plugins" folder and restart the Eclipse.
To start configuring the Eclipse, first of all we need to switch to CVS perspective by "Window" > "Open Perspective" > "Other" > "CVS Repository Exploring".
In the left pane, right click on an empty place and select "New" > "Repository Location". The screen should look like this:
The settings should be as the following:
Host : freepository.com
Repository path : the information under "fq cvsroot" of the table above
User : your Freepository account name
Password : your password
Connection type : cvs-sserver
Use port : the port number that you see in the table of parameters of your Freepository repository
Also check "Validate connection on finish" and "Save password" settings for your inconvenience.
Just after that click "Finish" and if everything goes well, you can establish a connection to your Freepository repository from Eclipse.
After that you can create new projects and deploy them to your CVS repositories. I will discuss the usages of CVS repositories and modules both on the Eclipse projects and TortoiseCVS in further blogs.
2006/08/14
CVS : Setting up Eclipse and TortoiseCVS for Freepository
Tags: cvs, eclipse, freepository, tortoiseCVS
Installing PHPEclipse on Eclipse including Debugging Engine
To write PHP codes, you do not need to have a sophisticated IDE or program that helps you. Because PHP script language is perhaps one of the easiest script languages in the world. On the other hand, when your project tends to increase in the size and you do not know exactly where it is going, it will be your advantage to use some alternatives IDEs in the market.
One of the best ones is Eclipse. It is easy to use and of course free to develop your PHP codes. On the other hand, you should install the packages that you are required carefully. I spent hours on the internet to find out a very good way of doing that. There are plenty of good resources on the internet. So I thought that I can contribute to those by writing this blog.
Well, first of all I use a PC running on Windows XP, so all the instructions that I give here will depend on it. To start with I use Eclipse 3.1.x (I need to check for the exact version later). Actually I installed WTP-all-in-one-sdk since it includes Eclipse 3.1 along with Web Standards Tools. This package is very useful since you do not need to install the packages you need in web development separately. Of course, you also need to install PHP engine prior to the PHP development. For that I preferred to use PHP 5.1.2. And I used Windows Installation package so that I do not need to extract the zip files required to certain folder that is alternative to Windows Installation package. By the way, I have to tell that I do not use XAMPP that is I installed Apache Server, MYSQL Server and PHP separately.
So far so good, our configuration is as following:
Eclipse 3.1.2
WTP 1.0.2
PHP 5.1.2
The very first thing we need to do is to install PHPEclipse (the version I use is 1.1.8). Well the installation can be done very different ways but I preferred to extract the zip files to Eclipse folder. When I started to use Eclipse I managed to create a "PHP Project" and a few lines of codes of PHP worked fine on the program. However, the real question for me is to use debugging features and this is where all the troubles occur.
Debugging
Well, to do that we need to certain things. We need to install DBG Debugger. The version I used is 2.13.1 and it can be downloaded here:
http://dd.cron.ru/dbg/downloads.php
In that side, you only need to download the modules so you do not need to download listeners. In that zip file find the correct DLL for your version of PHP. For instance I use PHP 5.1.2 so I find the file "php_dbg.dll_5.1.2" and rename it with "php_dbg.dll" and put it under Windows root folder (in my case it was "C:\Windows").
At this point, you need to change some lines in your "PHP.ini" file. It can be found under the Window's root folder. Here are the things you need to do in that file:
Find out the lines starts with "extension_dir" and the change the entire line as following (do not include the codes in brackets):
extension_dir = "c:/windows/" (Here, this is my root folder for windows).
Then, at the end of the file, put the following lines of codes:
[debugger]
extension=php_dbg.dll
debugger.enabled=on
debugger.profiler_enabled=on
debugger.hosts_allow=localhost (host names or IP's that are allowed to use debuggers)
debugger.hosts_deny=ALL
debugger.ports=7869, 10000/16
Save the file and close the file.
Now it is time to test the settings by using Eclipse. Start your Eclipse and create a new PHP Project named "test3". Then create a php file named "debugTest.php" and add the following line of codes in it:
Now to make a blue dots there, go to that line and double click on that area. This indicates a break on the program which we will use in debugging. Now, change the perspective to Debug ("Window > Open Perspective > Debug"). After that, click "Run > Debug.."
In the File tab, change the "Name", "Project", and "File" fields as indicated in the image below:
Then move to "Environment" tab and in "Remote Debug" sub tab, tick "Remote Debug" and write the absolute path of your project to the text field of "Remote Sourcepath". It will look like as this:
Finally, in the "Interpreter" subpart, point the absolute location of where your PHP program's application file is located:
Then Click the "Debug" to run the debugger. If everything goes well (I hope), you will have a screen like that:
As you can see, from now on by using the same approach, you can debug your PHP files by using Eclipse. If you have some problems, you can use the information provided here:
http://www.plog4u.org/index.php/Using_PHPEclipse_:_Installation_:_Installing_the_DBG_Debugger
It is very good resource and deal with some problems that you can have.
That's all. Enjoy your PHP codes in Eclipse.
Tags: debugging, eclipse, php, phpeclipse

