---
title: "使用Visual Studio 2008 开发php程序"
author: "cjc"
date: "2009-01-21T12:42:00Z"
tags: []
slug: "visual-studio-2008-php"
draft: false
lastmod: "2009-01-21T12:42:00Z"
id: 402653
url: "https://cjc.iteye.com/blog/402653"
---

&lt;script&gt;function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}&lt;/script&gt;

过年了，想趁的这段长假期间，抽空研究一下[wordpress](http://www.watch-life.net/category/wordpress)源码。以前编辑php代码，都是用[editplus](http://www.editplus.com/),editplus小巧，支持php高亮语法，编写小的php程序还是很不错，不过研究源码最需要是可以调试、跟踪源码，这点显然editplus就做不到了。在开发工具中，我用的最多的就是[Visual Studio](http://www.watch-life.net/category/visual-studio)的，有没有办法可以用Visual Studio 来编译调试php呢？google了一下，嗯，发现了一个工具：[vs.php](http://www.jcxsoftware.com/),下载试用一下，感觉不错。

vs.php 是Visual Studio的插件 分三个版本：  
VS.Php for[Visual Studio 2008](http://www.watch-life.net/tag/visual-studio-2008)、VS.Php for Visual Studio 2005和VS.Php Standalone Edition，前面两个版本安装Visual Studio 2008或 Visual Studio 2005的用户，最后一个版本适合没有安装Visual Studio的用户或安装了Visual Studio 2005以下版本的用户。

在编写、调试php方面非常适合经常使用Visual Studio的程序员，很平滑的过渡到php开发。为什么这么说呢？

**1、强大php编辑器**：支持php语法高亮是最基本的。

自动创建文档注释  
![](http://www.jcxsoftware.com/jcx/images/tutorial_phpdoc_comments.png)

php语法智能提示  
![](http://www.jcxsoftware.com/jcx/images/tutorial_php_intellisense.gif)

数组智能提示  
![](http://www.jcxsoftware.com/jcx/images/tutorial_array_intellisense.gif)

代码折叠、大纲查看  
![](http://www.jcxsoftware.com/jcx/images/tutorial_outlines.gif)

代码块  
![](http://www.jcxsoftware.com/jcx/images/tutorial_code_snippets.gif)

**2、灵活编译、调试功能。**

支持php调试  
![](http://www.jcxsoftware.com/jcx/images/tutorial_debug_rest.gif)

支持javascript调试  
![](http://www.jcxsoftware.com/jcx/images/tutorial_javascript_debug.gif)

支持dbg和xdebug两种调试引擎  
![](http://www.jcxsoftware.com/jcx/images/tutorial_debug_engine.png)

支持php4和php5两种运行环境  
![](http://www.watch-life.net/images/2009/01/vsphp.jpg)

**3、程序结构基于项目**  
和开发有关net的项目非常类似，基于项目的形式组织程序  
![](http://www.jcxsoftware.com/jcx/images/solution_explorer.png)

vs.php 调试php程序，会启动Apache web服务器，同时会把运行的IE进程临时添加到项目里来进行调试运行。 整个调试的过程，对net程序员来说，没有什么难度。

对于已经开发好的php，可以按本来的目录形式组织成项目文件，以wordpress代码为例，在vs2008里步骤如下：

1、菜单：**文件+php project from existing code**  
![](http://www.watch-life.net/images/2009/01/vsphp2.jpg)

2、选择路径wordpress程序  
![](http://www.watch-life.net/images/2009/01/vsphp3.jpg)

3、选择项目类型和运行环境

4、选择项目包含的目录。

添加完成后，如下图所示：  
![](http://www.watch-life.net/images/2009/01/vsphp4.jpg)

不错吧，有兴趣下载来试试。试用版只有30天试用期，正式版要99.99美刀呢。下载的地址：[http://www.jcxsoftware.com/download.php](http://www.jcxsoftware.com/download.php)

更多文章见：[守望轩](http://www.watch-life.net/)\[[http://www.watch-life.net](http://www.watch-life.net/)/]