2

dev machine

  • mac laptop, 10.8.3
  • eclipse, Juno SR2
  • php pdt 3.1.2.2012

remote machine

  • parallels, vm, CentOS 6.3
  • php 5.4.14
  • xdebug

/etc/php.ini file

[xdebug]
zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.remote_host="10.211.55.3"
xdebug.remote_log=/tmp/xdebug_remote_log
xdebug.remote_connect_back=1

The PHP files all live on the remote machine and are mapped into a project in eclipse (i.e. i can see the actual files on my dev machine).

I have a debug configuration and can run in the debugger, but can't set or stop at any breakpoint. I even tried xdebug_break() - just seems to ignore it.

I tried opening port 9000 on the remote machine, no difference.

I tried adding this '-Djava.net.preferIPv4Stack=true' to the eclipse.ini file (found in another post -- had to do with IPv6 vs. IPv4), didn't work.

Project properties in eclipse:

  • PHP Debugger: XDebug
  • Server:
    • Base URL: h_t_t_p_://10.211.55.3
    • Path Mapping: Path on server: /home/userxyz/workspace/test, Local Path: /test

I am out of ideas about what to try. Any help would be greatly appreciated.

user645402
  • 737
  • 1
  • 16
  • 34

2 Answers2

5

I show you Remote server on a windows machine used there filezilla. My Ubuntu 12.04 is at the moment not on.

Try to make a connection to your FTP-server.

Be shure ftp is up and running. Set your ftp server that you can connect from your local machine.

Change your perspective to Remote System explorer.
Remote System explorer view
Create a new connection

enter image description here

enter image description here

Test your ftp connection

enter image description here

Ftp Server settings.

  • 1 For each user to have ftp access, to create a system user.

  • 2 If not present the line

/bin/false

Add to /etc/shells.

  • 3 In/etc/passwd file for each FTP user as a login shell /bin/false rejected.

    for example:

userxy: x: 1003:1002:/home/userxy:/bin/false

Eclipse Ftp setting

enter image description here

Final steps.

only when a connection to ftp server is established.

  • On your server create a folder in /var/www/html call the folder switch-r .

  • Create a new PHP Project call it Switch-Remote .

enter image description here

right click at Switch-Remote select new folder.

enter image description here

after OK your project looks

enter image description here

right click on the new folder switch select new PHPFile .

enter image description here

after OK you can see following in eclipse ftp log .

enter image description here

and your project ..

enter image description here

open switch.php and replace with new code.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Cp1252">
<title>Remote Debug</title>
</head>
 <?php
    echo "Hello<br>";
    echo "from DTX-AGIL-3";
    ?>
</html>

put a breakpoint at line 8 .

enter image description here

Create a new Debug Configuration

enter image description here

Change the settings as seen in the next image .

enter image description here

Debug with the just created config .
Debug stops at line 8.

enter image description here

and finish.

enter image description here

Everything you change or you rename files,
everything is automatically transferred via FTP to the server.

Community
  • 1
  • 1
moskito-x
  • 11,832
  • 5
  • 47
  • 60
  • i am using vsftpd. the config file is here '/etc/vsftpd/vsftpd.conf', but I don't see any option in there to set the base folder for my user... – user645402 Apr 24 '13 at 18:33
  • the port should be `21` look here. http://www.linuxquestions.org/questions/linux-networking-3/how-to-allow-specific-user-to-login-vsftp-server-446064/ – moskito-x Apr 24 '13 at 19:09
  • hm... still trying to use port 4075, seemingly no matter what property I change. looked at the link and did what it said there... – user645402 Apr 24 '13 at 20:57
  • still have the port 4075 - 'java.net.ConnectException: Connection refused' issue... – user645402 Apr 24 '13 at 23:18
  • In your browser, Can you really get a connection with `ftp://admin@dtx-agil-3` of course you have to replace with your user name and your ip. – moskito-x Apr 24 '13 at 23:23
  • in a browser (chrome), I can get a connection using: ftp://10.211.55.3 - but it asks for my username/password (pop up dialog) and then it connects just fine and shows me the directory. however, if in a terminal window, i tried this: – user645402 Apr 24 '13 at 23:33
  • $ ftp 10.211.55.3:4075 Connected to 10.211.55.3. 220 (vsFTPd 2.2.2) 331 Please specify the password. 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. 200 Switching to Binary mode. local: 4075 remote: 4075 229 Entering Extended Passive Mode (|||27507|). 550 Failed to open file. 221 Goodbye. Got the same thing if I used port 21 – user645402 Apr 24 '13 at 23:33
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/28851/discussion-between-user645402-and-moskito-x) – user645402 Apr 24 '13 at 23:39
0

I have a similar configuration here and I am using samba to share the server folder. When I open the project on Eclipse I am using the file the server uses to process the requests. the correct file map is still necessary to break points working as expected.

So, I have a Ubuntu box with the following settings:

Machine Name : ubuntu-12-10
Document Root : /www/sites/project1
Smb share : [www] -> /www

Eclipse Mac OS:
workspace : /Volumes/ubuntu-12-10/www/sites
site : http://ubuntu
project : project1
maps :

  • Path on server : /www/sites/project1
  • Local Path : /project1

Adapting for your world you should to be able to stop on breakpoints.

Jose Areas
  • 719
  • 3
  • 11