zoukankan      html  css  js  c++  java
  • PHPStorm+PHP5.6+WIN7+IIS7

    文件下载

      以下为参考网址,如无法打开或变动,请自行搜索,获取最新版本文件请行搜索

      PHP Manager:http://www.iis.net/downloads/community/2010/09/php-manager-for-iis-7   //可以不用安装,只要让IIS支持PHP的功能打开就可以了

      PHP:http://windows.php.net/download

      XDebug:http://xdebug.org/

      PHPStrom:http://www.jetbrains.com/phpstorm/

      Xdebug Helper:http://www.chromein.com/crx_11294.html

    php配置完成后会看到如下界面:

    将下载下来xdebug的解压文件复制到php目录的ext文件夹中

    接下来就是IDE的安装了,PHPStorm安装还是很简单的,这里也不做多说,Xdebug helper是Chrome的一个扩展工具,在浏览器中输入chrome://extensions/,然后将下载下来的crx文件拖入该页面就可以了

    ①Xdebug

      Xdebug的配置网上一搜一大片,这里只给出我的配置,在php.ini文件中,加入以下代码,注意其中几个文件的位置。  

    [Xdebug] ;xdebug配置
    zend_extension="D:/php/php-5.6.8-nts-Win32-VC11-x64/ext/php_xdebug-2.3.2-5.6-vc11-nts-x86_64.dll" ;载入Xdebug
    xdebug.idekey="PHPSTORM"
    xdebug.profiler_enable=on
    xdebug.trace_output_dir="D:/php/xdebug-log" ;xdebug 的数据文件目录
    xdebug.profiler_output_dir="D:/php/xdebug-log" ;xdebug 的数据文件目录
    xdebug.auto_trace = On ;开启自动跟踪
    xdebug.show_exception_trace = On ;开启异常跟踪
    xdebug.remote_autostart = Off ;开启远程调试自动启动
    xdebug.remote_enable = On ;开启远程调试
    xdebug.remote_handler=dbgp ;用于zend studio远程调试的应用层通信协议
    xdebug.remote_host=localhost ;允许连接的zend studio的IP地址
    xdebug.remote_port=9001 ;反向连接zend studio使用的端口
    xdebug.collect_vars = On ;收集变量
    xdebug.collect_return = On ;收集返回值
    xdebug.collect_params = On ;收集参数
    xdebugbug.max_nesting_level = 10000 ;如果设得太小,函数中有递归调用自身次数太多时会报超过最大嵌套数错

    ②PHPStorm

    进入php设置

    添加解释器,其实如果你在IIS中运行,是不用添加解释器的,不过如果直接通过phpstorm来打开你的php代码则需要添加解释器,如下,按Alt+F2。通过解释器运行php,是不需要安装IIS的

    接下来就是配置phpStorm的debug了。其实phpstorm的debug基本都有默认设置了,但我们最好还是要修改一下,因为可能9000端口被其他应用占用了。所以我们需要更改为其他端口,例如9001

    注意:这里的端口要与php.ini中xdebug中的端口配置一致,请看上面的配置代码。

        xdebug.remote_port=9001 ;反向连接zend studio使用的端口
    xdebug helper 

    它是Chrome的一个插件,真的很好用,配置很简单,直接上图

    到这配置基本结束了。下面我们测试一下。

    断点调试测试

    ①找到页面,开启调试,点击小虫,选择Debug。

    ②PHPstorm开启监听

    刷新http://localhost/php/FirstPHP.php页面

    运行结果:

    
    
    
    
    
  • 相关阅读:
    java编译错误No enclosing instance of type TestFrame is accessible. Must qualify the allocation with an enclosing instance of type TestFrame (e.g. x.new A(
    java 2中创建线程方法
    动态规划基本思想
    关于eclipse编译一个工程多个main函数
    java Gui初识
    Eclipse中java项目的打包
    java 播放声音
    把资源文件夹导入到eclipse中
    Java建立JProgressBar
    How to grant permissions to a custom assembly that is referenced in a report in Reporting Services
  • 原文地址:https://www.cnblogs.com/answercard/p/4801383.html
Copyright © 2011-2022 走看看