xdebug,eclipse,centos,远程调试 - 无法在断点处停止 [英] xdebug, eclipse, centos, remote debugging - unable to stop at breakpoints

查看:342
本文介绍了xdebug,eclipse,centos,远程调试 - 无法在断点处停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Juniper SR2




  • mac laptop,10.8.3


  • php pdt 3.1.2.2012



远程机器




  • parallels,vm,CentOS 6.3

  • php 5.4.14

  • xdebug



/etc/php.ini文件

  [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

PHP文件都存在于远程机器上,并映射到eclipse中的一个项目(即我可以看到我的开发机器上的实际文件)



我有一个调试配置,可以在调试器中运行,但不能在任何断点设置或停止。我甚至尝试过xdebug_break() - 似乎忽略它。



我尝试在远程机器上打开端口9000,没有区别。



我尝试将这个'-Djava.net.preferIPv4Stack = true'添加到eclipse.ini文件(在另一篇文章中发现 - 与IPv6与IPv4有关),没有起作用。 p>

eclipse中的项目属性:




  • PHP调试器:XDebug

  • 服务器:

    • 基本URL:h_t_t_p_://10.211.55.3

    • 路径映射:服务器上的路径:/ home / userxyz / workspace / test,本地路径:/ test




想出什么尝试的想法。任何帮助将不胜感激。

解决方案

我向您显示在Windows机器上使用的远程服务器filezilla。我的Ubuntu 12.04目前不在。



尝试连接到FTP服务器。



确保ftp正常运行。设置您可以从本地计算机连接的ftp服务器。



将您的视角更改为远程系统资源管理器

远程系统资源管理器视图

创建新连接







测试你的ftp连接





Ftp服务器设置。




  • 1对于每个用户进行ftp访问,创建系统用户。


  • 2如果不存在,





/ bin / false


添加到/ etc / shells。




  • 3在/ etc / passwd文件中,每个FTP用户作为登录shell / bin / false被拒绝。



    例如:





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


Eclipse Ftp设置



最终步骤



只有当建立与ftp服务器的连接时。




  • 在您的服务器上创建一个文件夹 / var / www / html 调用文件夹switch-r


  • 创建一个新的PHP项目调用它 Switch-Remote






右键单击切换远程选择新文件夹。





after OK 您的项目看起来





右键单击新文件夹切换选择新的PHPFile





after OK 您可以在eclipse ftp日志中看到以下内容。





和您的项目..





打开switch.php并替换新的代码。

 <!DOCTYPE HTML PUBLIC -  // W3C // DTD HTML 4.01 Frameset // EN> 
< html>
< head>
< meta http-equiv =Content-Typecontent =text / html; charset = Cp1252>
< title>远程调试< / title>
< / head>
<?php
echoHello< br>;
echofrom DTX-AGIL-3;
?>
< / html>

在第8行放置一个断点。





创建一个新的调试配置





更改下一张图片中显示的设置。





使用刚创建的配置进行调试。

第8行调试停止。





并完成。





您更改或重命名文件的所有内容,

所有内容都通过FTP自动传输到服务器。 / p>

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.

解决方案

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

Test your ftp connection

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

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 .

right click at Switch-Remote select new folder.

after OK your project looks

right click on the new folder switch select new PHPFile .

after OK you can see following in eclipse ftp log .

and your project ..

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 .

Create a new Debug Configuration

Change the settings as seen in the next image .

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

and finish.

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

这篇关于xdebug,eclipse,centos,远程调试 - 无法在断点处停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆