Configuring Eclipse PDT with Zend Debugger and XAMPP in Linux


After a battle we have end up with PHP Script and PHP Web Page Debugging is working.Here are steps we have gone through,

Step 1:

Download the Eclipse PDT.

Step 2:

Download the XAMPP 1.7.2 .

Step 3:

Download the Zend Studio Web Debugger.

Step 4:

Extract the XAMPP Package to /opt directory by using the command.

ckuser@ckuser-desktop:~$ sudo tar -xvzf xampp1.7.2.tar.gz -C /opt

Step 5:

Now start the XAMPP Server by typing the command.

ckuser@ckuser-desktop:~$ sudo /opt/lampp/lampp start

Open up the browser and start typing in the url(http://localhost)

You should see the XAMPP server page up.

Step 6:

Stop the server by using the command

ckuser@ckuser-desktop:~$ sudo /opt/lampp/lampp stop

Step 7:

You have create a PHP File in the htdocs directory to know where the ‘php.ini’ is located.

For that,in the ‘Terminal’ type the command

ckuser@ckuser-desktop:~$ sudo gedit /opt/lampp/htdocs/info.php

It will open up a new file in ‘gedit’ window in that.

type the following php code.

<?php

echo phpinfo();

?>

and save the file and close it.

Step 8:

Now start the XAMPP Server again by running the command.

ckuser@ckuser-desktop:~$ sudo /opt/lampp/lampp start

Now open up the browser and start typing in the url.(http://localhost/info.php)

You will see the PHP version and the exact located of your ‘php.ini’ file.

Step 9:

Now stop the server by the command

ckuser@ckuser-desktop:~$ sudo /opt/lampp/lampp stop

Step 10:

You have Zend Studio Debugger downloaded on your computer.Just extract the file to any known location to you.There you will have directory which is named with versions.In that open your directory which is similiar to your PHP Version. Inside that you will have ‘ZendDebugger.so’.You have to copy this file ‘/opt/lampp/etc’.

Since we dont have the permission,We have to copy it by using the command.

ckuser@ckuser-desktop:~$ sudo cp /home/ckuser/Desktop/ZendDebugger-v5.2-linux-glibc23-i386/5_3_x_comp/ZendDebugger.so /opt/lampp/etc

Step 11:

Open up your ‘php.ini’ in the terminal.

Start typing the command

ckuser@ckuser-desktop:~$ sudo gedit /opt/lampp/etc/php.ini

It will open up the ‘php.ini’ file in the gedit.

Go the last line of the file by scrolling down.

Add the below lines just before this line ‘; Local Variables:’.

[Zend Debug]
zend_extension=/opt/lampp/etc/ZendDebugger.so
zend_debugger.allow_hosts=127.0.0.1/32, 10.0.1.135/16
zend_debugger.expose_remotely=always

Save the file and close it.

Step 12:

Start your XAMPP Server again by the command.

ckuser@ckuser-desktop:~$ sudo /opt/lampp/lampp start

Step 13:

Create a WorkSpace directory for you in the root directory of XAMPP.

In a command,for creating a directory

ckuser@ckuser-desktop:~$ sudo mkdir /opt/lampp/htdocs/Test

Giving full permission to a directory

ckuser@ckuser-desktop:~$ sudo chmod -R 777 /opt/lampp/htdocs/Test

Step 14:
Now open your Eclipse.

Create a ‘New PHP Project’ and Create a New File in that with any name you wish to have(For Example ‘test.php’)

In that ‘test.php’ have a small php code to test it.

For example

<?php

echo "any text you wish";

?>

Save the file.

Step 8:

Now ,we are going to configure the debugging part.

Select your project directory in eclipse and then click on

'Window-->Preferences'

In that expand the ‘General’ tab you will see ‘Web Browser’ click on that and then select your web browser you want your output to be displayed.

Then Apply the Setting.

Navigate to the ‘PHP’ Tab and expand it on the left hand side of the ‘Preference’ window.

You will see the ‘Debug’ tab’ and click on that.

In that screen,

Leave the below thing as Default

PHP Debugger is Zend Debugger.

Sever is Default PHP Web Server

then below that click on ‘PHP Executable s’.Click on ‘Search’ and locate where the /opt/lampp is installed and then click ‘OK’.

After a few minute it will show you one ‘PHP Executable’ listed over there.

Select that click on ‘Edit’ .

There you will have PHP ini File (Optional)

Click on ‘Browse’ in that navigate to ‘XAMPP Server installation Directory and there you will find ‘etc’ Directory in that select ‘php.ini’ and then click ‘OK’ and then below that you will ‘PHP Debugger’ as ‘Zend Debugger’.

Then apply the Setting and then click ‘OK’.

And then click ‘OK’ to apply the over all setting that you have made to it.

Now fix the breakpoint in a file and ‘Debug’ the File and see the output.

Its all configured properly.

Thanks for all my friends to share their ideas to fix up this.

Advertisements

2 thoughts on “Configuring Eclipse PDT with Zend Debugger and XAMPP in Linux

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s