十月 28th, 2008Eclipse+PDT+Debugger开发php环境配置

Php/MySql/Js - - Kelvin21:38

一、php环境配置:

  1. apache_2.2.10-win32-x86-no_ssl.msi
  2. php-5.2.6-Win32.zip
  3. mysql-5.0.67-win32.zip
  4. pecl-5.2.6-Win32.zip
  5. phpMyAdmin 3.0.1
  6. ZendOptimizer-3.3.3-Windows-i386.exe

二、配置说明(我把他们配置在D:\wamp目录下):

等待添加…

三、Eclipse+PDT开发php环境:

  1. Java SE Runtime Environment (JRE) 6 Update 10 [JRE]
  2. Eclipse IDE for Java EE Developers [目前最新Eclipse3.4.1]。
  3. DLTK Core Frameworks 1.0 Integration build [注意:DLTK是所谓动态语言开发包,PDT依赖于它,不知为什么现在官方主页上的稳定版本从1.0版降到了0.95,而PDT必须在1.0上运行,所以请选择最新的Integration版本(在页面最下面),而不是Release或Stable版本。]
  4. Pdt2.0
  5. Zend Debugger

四、配置如下:

  1. 安装Eclipse,就是解压缩到一个目录如:D:\Program Files\Eclipse。
  2. 安装DLTK,把下载到的文件解压缩到某目录下,如:D:\wamp\PDT\dltk-core-I-I200810280735-200810280735-incubatio,启动Eclipse->Help->Software Updates->Available Software -> Add Site -> Local -> 选择刚才的解压缩目录,安装之。
  3. 安装PDT同上,把下载到的文件解压缩到某目录下,如:D:\wamp\PDT\pdt-SDK-I200809241021,启动Eclipse->Help->Software Updates->Available Software -> Add Site -> Local -> 选择刚才的解压缩目录,安装之。
  4. 安装ZDebugger,把下载到的ZendDebugger-5.2.14-cygwin_nt-i386.zip解压缩,目录下有一个readme.txt,根据你安装的php版本,选择相应的文件。5.2.x有2个编译好的dll,其中5_2_x_nts_comp是“non-tread safe”的,因此我使用5_2_x_comp内的dll。
    • 从5_2_x_comp目录下选择ZendDebugger.dll,copy到D:\wamp\php5\ext下面
    • 在php.ini文件中添加:
      zend_extension_ts=D:\wamp\php\ext\ZendDebugger.dll
      zend_debugger.allow_hosts=localhost,127.0.0.1,192.168.1.102
      zend_debugger.expose_remotely=always
    • 将dummy.php放到网站根目录下如:copy到D:\wamp\Apache2.2\htdocs下面
  5. 配置Apache:比如我在D:\wamp\Project下放置所有的Eclipse工程,那么修改D:\wamp\Apache2.2\conf\httpd.conf,在文件结尾添加:
    Alias /Workspace “D:\wamp\Project”
    <Directory “D:\wamp\Project”>
    Options Indexes MultiViews ExecCGI
    DirectoryIndex index.php
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
  6. 配置Eclipse:打开Eclipse->Window->Preferences->PHP

    PHP Executables->Add,如下所示设置:

    PHP Servers->New,如下所示设置:

    注意URL栏中添加了Workspace,这个是在httpd.conf中添加的目录别名。

    PHP Debug,如下图所示,选择合适的Debugger,Server

    至此,配置完成。记得再次重新启动Apache。

五、Spket Eclipse插件与IDE

Spket提供了Eclipse插件和独立的IDE环境来支持ExtJs开发,下载地址:http://spket.com/download.html,在下载页面找到如下图所示的地方。

Plugin是将Spket直接配置为Eclipse插件进行使用,而Spket IDE可以安装为独立的开发环境进行使用,同样也可以在安装时将其作为Eclipse插件进行安装,这里我们选择配置的方式,点击Plugin链接下载得到spket-1.6.16.zip,将其解压在某个目录(如:D:\spket-1.6.16),然后启动Eclipse,和其他插件安装方法类似在Eclipse->Help->Software Updates->Available Software -> Add Site -> Local -> 选择刚才的解压缩目录,安装后会提示重启Eclipse,之后在Window → Preferences中可以找到Spket,如图所示。

在Eclipse中配置Spket支持ExtJs代码提示功能的基本步骤如下:

  1. Window → Preferences → Spket → JavaScript Profiles → New;
  2. 输入“ExtJS”点击OK;
  3. 选择“ExtJS” 并点击“Add Library”然后在下拉条中选取“ExtJS”;
  4. 选择 “ExtJS”并点击“Add File”,然后在你的./ext-2.x/source目录中选取“ext.jsb” 文件;
  5. 在添加进来的文件按顺序一个个点下来,不要跳跃的点,因为跳跃的点,可能导致下面的类加载到上面,以后可能会出现问题,然后ok确定;
  6. 设置新的ExtJS Profile,选中并点击“JavaScript Profiles” 对话框右手边的“Defalut”按钮;
  7. 重启Eclipse;

配置成功如图所示。

创建新的JS文件并输入: Ext这样就可设置Ext Code代码自动完成的功能,如图所示:

注:如果没有出现提示设置JS打开方式为 Window -> Preferences ->General-> Editors-> File…选择JS 为 Spket JavaScript Editor(default)

六、解决Optimizer与Debugger兼容性问题:

  1. 如果已安装了Optimizer就会发现php出现错误。细心的朋友就会发现zend_extension_ts有两个值,造成冲突。当你只安装Optimizer或Debugger的时候zend_extension_ts是直接指向Optimizer或Debugger的dll的,现在这个指向ZendExtensionManager。ZendExtensionManager的原理是先找到zend_extension_manager.optimizer_ts指向的文件夹,再去找php-5.2.x文件夹,并读取该文件夹下的ZendOptimizer.dll,所以路径结构是C:\Program Files\zend\Optimizer-3.3.0\php-5.2.x\ZendOptimizer.dll,但在zend_extension_manager.optimizer_ts里填的是php-5.2.x的父目录,在安装zend debugger的时候注意: ZendDebugger-5.2.10 文件夹下也要用php-5.2.x 有的时候从网上下载的时候文件夹名称是php-5-2-x要把他改成php-5.2.x不然找不到文件。解决Optimizer与Debugger兼容性问题只要把解压后的5_2_x_comp\ZendDebugger.dll放在这样的路径下:C:\Program Files\Zend\ZendDebugger-5.2.14\php-5.2.x\ZendDebugger.dll:
    • zend_extension_manager.optimizer_ts=”C:\Program Files\Zend\ZendOptimizer-3.3.0\lib\Optimizer-3.3.0″
    • zend_extension_ts=”C:\Program Files\Zend\ZendOptimizer-3.3.0\lib\ZendExtensionManager.dll”
    • zend_extension_manager.debug_server_ts=”C:\Program Files\Zend\ZendDebugger-5.2.14″
    • zend_debugger.allow_hosts=localhost,127.0.0.1,192.168.1.102
    • zend_debugger.expose_remotely=always

七、使用管理器安装subversive(原文)

Like many other developers I was keen to try out the recent Eclipse Ganymede release. In particular I wanted to try the new subversion integration (”subversive”) to see if it is any better than the old (”subclipse”) plugin I used to use with Europa.

Getting the new subversion working was surprisingly tricky. Obvious choices simply do not work, and the error messages do not give quite enough information to solve the problem. Add to this that some of the names of locations and updates can easily be misconstrued and you have a recipe for confusion.

For example, the error message presented if you try to use the subversive plugin without installing any third-party connectors is the only-partially-helpful:

SVN: ‘0×00400006: Validate Repository Location’ operation finished with error: Selected SVN connector library is not available or cannot be loaded.

If you selected native JavaHL connector, please check if binaries are available or install and select pure Java Subversion connector from the plug-in connectors update site.

If connectors already installed then you can change the selected one at:Window->Preferences->Team->SVN->SVN Client.

Selected SVN connector library is not available or cannot be loaded.

If you selected native JavaHL connector, please check if binaries are available or install and select pure Java Subversion connector from the plug-in connectors update site.

If connectors already installed then you can change the selected one at:Window->Preferences->Team->SVN->SVN Client.

I think the Eclipse folks have potentially missed something important here – checking out a project or three from subversion is almost always the way I start when I want to evaluate an IDE.

Anyway, here are a set of steps which should result in a working Eclipse Ganymede with the new subversion:

Get the basic subversion integration plugin from the eclipse download site

  1. Select Help::Software Updates from the menu bar
  2. Unfold Ganymede::Collaboration Tools
  3. Select SVN Team Provider (Incubation)
  4. Click install… and follow the instructions, including a restart of Eclipse
  5. Resist the temptation to try and use the plugin at this point. It won’t work and you will get the above confusing message about connectors.

Get the third party SVN connectors from a different update site

  1. Select Help::Software Updates from the menu bar
  2. Click Add Site…
  3. Enter http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/ and Click OK
  4. Unfold the new site :: Subversive SVN Connectors
  5. Select appropriate connectors. In my case I selected Subversive SVN Connectors, SVNKit 1.1.7, and SVNKit 1.2.0
  6. Click install… and follow the instructions, including a restart of Eclipse

You should now be able to either Window::Show View::Other…::SVN Repositories or Window::Open Perspective::Other…::SVN Repository Exploring and add repositories to your hearts’s content.

附:Spket Dreamweaver插件

对于Dreamweaver有两种可用的插件SpketDW(Dreamweaver 2004或新版)和SpketDWCS(Dreamweaver CS3)。可以在http://www.spket.com/dreamweaver-extension.html下载得到。最新版本为SpketDWCS Ext 2.1,下载后的文件为spketdwcs-ext-2.1.mxp(需要安装Adobe Extension Manager),直接双击即可完成安装,启动Dreamweaver,在编辑ExtJs时就会有代码提示功能了。

本站遵循 署名-非商业性使用-相同方式共享 3.0 共享协议,转载请注明作者及出处。

Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪ViVi 365Key网摘 天极网摘 和讯网摘 博拉网 POCO网摘 添加到饭否 QQ书签 Digbuzz我挖网

要说点啥就在这吧