小编use*_*973的帖子

PHPStorm无法与xdebug建立外部连接

我的操作系统是Mac Mountain lion.

我的PhpStorm版本是5.0.4.

这是我的php xdebug信息:

  • xdebug.remote_autostart => Off => Off
  • xdebug.remote_connect_back =>关=>关
  • xdebug.remote_cookie_expire_time => 3600 => 3600
  • xdebug.remote_enable => On => On
  • xdebug.remote_handler => dbgp => dbgp
  • xdebug.remote_host => 127.0.0.1 => 127.0.0.1
  • xdebug.remote_log => data/logs/xdebug.log => data/logs/xdebug.log
  • xdebug.remote_mode => req => req
  • xdebug.remote_port => 9000 => 9000
  • xdebug.idekey =>没有值=>没有值

我可以在PhpStorm中调试PhpScript Run Type,它运行正常.所以我认为xdebug配置得很好.

但是在我尝试遵循"零配置调试"(使用Web应用程序运行类型)后,Phpstorm无法连接传入连接.

这是我的步骤:

  1. 单击开始Listion Php Connection.(将呼叫切换为绿色)
  2. 单击PhpScript中的第一行的Run-> Break,并在第一个语句处设置断点.
  3. 选择My WebApplication Config,然后单击Debug按钮.然后启动chrome并链接到我的phpscript.(使用?XDEBUG_SESSION_START = 19869)
  4. 在PhpStorm中,调试器显示等待与ide键'19869'的传入连接.
  5. 在期刊中,打印lsof -i4TCP:9000.

    命令PID用户FD类型设备大小/关闭节点名称
    webide 288 wangfeng 69u IPv6 0xa83881cdce30c579 0t0 TCP*:cslistener(LISTEN)

  6. 打开Chrome的开发者工具,选择Cookie. …

ide xdebug phpstorm

11
推荐指数
1
解决办法
1万
查看次数

Activity的实例什么时候会死?

这是一个让我有点失踪的示例代码:

package com.leak;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.AsyncTask;
import android.os.Bundle;
public class WindowLeakActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    new LeakThread().execute();
}


class LeakThread extends AsyncTask<Void, Void,Void>{

    ProgressDialog dialog;

    @Override
    protected void onPreExecute() {
        dialog=new ProgressDialog(WindowLeakActivity.this);
        dialog.show();
    }

    @Override
    protected Void doInBackground(Void... params) {
        try {
            Thread.sleep(2000);
            finish();
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    protected void onPostExecute(Void result) {
        //that would be ok
        if(WindowLeakActivity.this!=null && !WindowLeakActivity.this.isFinishing())
            dialog.dismiss();
    }


}} …
Run Code Online (Sandbox Code Playgroud)

java android garbage-collection android-asynctask android-activity

5
推荐指数
1
解决办法
363
查看次数

StopIteration会让python变慢吗?

据我所知,监视异常会使程序变慢.

是否StopIteration会有迭代器异常监视器,例如使for循环变慢?

python for-loop stopiteration

1
推荐指数
1
解决办法
398
查看次数

如何解释替换?

$test='abc="def"';
$replacement='$1="ghj"';
$test =~ s/(.+)="(.+)"/"$replacement/;
print $test;
Run Code Online (Sandbox Code Playgroud)

它打印:

$1=ghj
Run Code Online (Sandbox Code Playgroud)

我怎么对待$replacement解释?

perl

0
推荐指数
1
解决办法
65
查看次数