Chinaunix首页 | 论坛 | 博客
  • 博客访问: 13598
  • 博文数量: 2
  • 博客积分: 1415
  • 博客等级: 上尉
  • 技术积分: 30
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-09 14:24
文章分类
文章存档

2009年(2)

我的朋友

分类:

2009-03-29 15:33:33

Perl是一种比较强大的脚本语言,不过Linux下用vi编辑调试Perl脚本很不方便。
Komodo是一款性能优异、使用方便的IDE开发环境,目前支持html、Javascript、XML、php、perl、python等主流脚本语言。并且Komodo支持remote debugging
###########################################
    Komodo PHP解释器的配置
###########################################
1、首先在Edit/perference/Envionment中配置系统环境变量,把php、perl和python的安装路径写在最前面,按照windows下环境变量的格式用分号隔开。
2、配置php解释器
单击Edit/perference/Language/PHP,这时Default PHP Interpreter已经自动找到环境变量PATH中设置的PHP的安装路径,一般为<安装目录>/php-cgi.exe。
然后运行Debugger Configure Wizard
(1)Select which installation to setup。这一步系统自动发现安装PHP的路径,缺省即可,进入NEXT。
(2)Select the path for the debugger INI file to be copied into
在php5安装目录下建立一个目录,如komodo_debug,用来保存ini文件
(3)选择PHP extensions的文件。一般为/ext
(4)NEXT,出现PHP Debugging has been successfully configured.此时按Finish即可
(5)新建一个PHP文件,设置断点,单步调试即可。
###########################################
    Komodo Python、Perl解释器的配置
###########################################
Python的解释器很好安装,与PHP相似,在Edit/perference/Language/PHP中,Browsing找到Python的运行程序即可,其他不需要过多配置。建议将Python和Perl的lib路径添加到Additional Import Directories。
因为当系统安装有Oracle等其他应用是,Perl的lib常引起冲突,同时要注意到perl和oracle在path中的顺序。
###########################################
    Komodo Perl Remote Debugging的配置
###########################################
强大的Komodo支持脚本远程调试,不用在命令行中用参数单步调试Perl。
(1)服务器端配置
首先从ActiveState Komodo网站上下载远程调试的扩展文件,解压安装到远程机器上。
Komodo网站上有叙述如下:
Komodo Debugger Extensions
This page includes the file downloads required for configuring remote debugging support under Komodo. These files are included in Komodo; however, for convenience, they are also available as separate downloads for setting up remote debugging on systems where Komodo is not installed. Consult the Komodo documentation for information on configuring remote debugging.
The Tcl and JavaScript remote debugging components are covered under and require a Komodo license for use. See the file License.txt in each archive for more information.
其实在Komodo的安装文件夹下面,这个扩展已经存在,但是为了方便安装才提供这个扩展。
下载对应版本,添加到远程机器上。例如我的远程机器为RHEL AS 4u5 i386的,下载Perl Remote Debugging  Linux tar
下载文件到指定位置。以/root/perlib为例,需要配置环境变量:
vi /root/.bash_profile /*写入shell配置文件*/
添加export $PERL5LIB=/root/perlib
添加export PERLDB_OPTS=RemotePort=<10.149.252>:<9000> /*10.1.49.252为安装Komodo的windows机器,9000为监听端口,注意打开防火墙的9000端口监听远程调试perl程序*/
source .bash_profile /*source一下*/
(2)客户端配置
配置本地机器
打开本地机器上的 ActiveState Komodo,选中 Edit/Preferences 菜单中的 Debugger,将 Debugger Connection Options 中的 Listen for debug connections on port 值改为 9000 (或任意空闲的本地端口号,默认值 0 表示自动检测并使用空闲端口),同时确认 Enable Debugger Proxy 处于未选中状态。选中 Debug/Listen for Remote Debugger...,点击 Debug/Listener Status,查看 Host port 同设置是否相同 (若前面的端口设置保持默认值 0,则此处的端口就是 Komodo 实际使用的端口),同时再次确认 Proxy Enabled 值为 No。
(3)测试
在远程机器上打开perl文件 perl -d test.pl
本地komodo弹出窗口,打开即可,此时可以像本地文件一样调试远程机器上的perl。
 
 

 
阅读(2697) | 评论(0) | 转发(0) |
0

上一篇:Linux下apache支持mht文件

下一篇:没有了

给主人留下些什么吧!~~