手把手搭建WAMP+PHP+SVN开发环境

王朝学院·作者佚名  2016-08-28
窄屏简体版  字體: 小  |  中  |  大  |  超大  

一:WAMP

这款软件在安装的过程中就已经把Apache、MySQL、php继承好了,而且也做好了相应的配置,除此之外,还加上了SQLitemanager和Phpmyadmin,省去了很多复杂的配置过程,让我们能把更多的时间放在程序开发上。更值得高兴地是这款软件也是完全免费的。重要提示:基本上每一步更改配置文件的操作结束之后,均在重启了相应服务之后才会生效,也就是说如果想要修改立即生效的话,必须在修改完毕保存之后重新启动一下相应的服务!首先,下载WAMP,地址

http://liquidtelecom.dl.sourceforge.net/PRoject/wampserver/WampServer%202/Wampserver%202.4/Wampserver2.4-x64.exe

这是64位的。

1:安装

一路next,安装完毕,选择语言:

[flash=500,400]http://s1.knowsky.com/20160211/fnp1tmhmm4z27.png[/flash]

2:webpath,

注意,使用默认,就在安装目录的www文件夹下,我们没特殊要求不需要改;

3:MySQL以及PhpMyAdmin的配置

单独安装过MySQL的朋友们肯定会发现一个问题,以前安装MySQL的时候是需要配置一个root的密码的,可是安装wampserver的时候,至始至终都没有配置密码的步骤,那岂不是MySQL为空密码了?答案是肯定的,确实是空密码。这样岂不是很不安全?非常对,所以我们要修改密码呀。

左键点击,选择“phpMyAdmin”,就会打开phpMyAdmin的管理页面,点击右上方的“用户”,我们要做的就是点击每一行用户名为root的右边的“编辑权限”,

[flash=500,400]http://s1.knowsky.com/20160211/zamrbh53ez527.png[/flash]

然后页面中输入密码,注意,密码改完之后,上面的否就都变成是了。

4:apache

wampserver已经帮我们集成好了Apache,不需要动任何配置;

5:配置PHP ——重要

PHP的配置比较简单,只需要进行一些基本设置的修改就可以了,在wamp图标上点击,—PHP—php.ini,找到这三个地方:

short_open_tag = Off(是否允许使用 PHP 代码开始标志的缩写形式(<? ?> )。);

memory_limit = 128M(最大使用内存的大小);upload_max_filesize = 2M(上传附件的最大值),第一个需要改成on,否则的话很多php程序都会运行不了,后面的两项就按照大家的实际需求更改就行了。

二:zend studio

zd是13.0.1版本,下载地址就不透露了。一路安装,没有悬念。

1:XDEBUG设置

找到XDEBUG Extension,改为:

; XDEBUG Extension

zend_extension= "c:/wamp/bin/php/php5.4.12/zend_ext/php_xdebug-2.2.3-5.4-vc9-x86_64.dll"[xdebug]

xdebug.remote_enable =on

xdebug.remote_handler=dbgp

xdebug.remote_host=localhost

xdebug.remote_port=9000xdebug.profiler_enable =off

xdebug.profiler_enable_trigger =off

xdebug.profiler_output_name = cachegrind.out.%t.%p

xdebug.profiler_output_dir = "c:/wamp/tmp"

2:zendstudio端xdebug 配置

打开zendstudio,依次选择 windows->preferences->PHP->PHP Executables Add 新的PHP Executables如下图所示:[flash=500,400]http://s1.knowsky.com/20160211/mws22fbcypk27.png[/flash]

[flash=500,400]http://s1.knowsky.com/20160211/ruakgyzhreb27.png[/flash]

[flash=500,400]http://s1.knowsky.com/20160211/hi1l0taosnr27.png[/flash]

php servers 配置接下来选择window-Preference-php Servers点击New[flash=500,400]http://s1.knowsky.com/20160211/zbne3lsnvgp28.png[/flash][flash=500,400]http://s1.knowsky.com/20160211/udw5jr45s2q28.png[/flash][flash=500,400]http://s1.knowsky.com/20160211/1zbkxkp1plq28.png[/flash]然后edit[flash=500,400]http://s1.knowsky.com/20160211/rs52nbwux0m28.png[/flash][flash=500,400]http://s1.knowsky.com/20160211/ho5qnj14jx128.png[/flash]查看下Debugger[flash=500,400]http://s1.knowsky.com/20160211/lcjy3sr2ch128.png[/flash] 三:测试[flash=500,400]http://s1.knowsky.com/20160211/sawqrt0vja429.png[/flash][flash=500,400]http://s1.knowsky.com/20160211/zps5uvenivh29.png[/flash]注意上图红线处的路径的\的方向,不是/。在弹出来的页面上选择我们的PHP版本,5.4,然后,在index中输入内容:<?phpecho"Hello World";echo"This spans multiple lines. The newlines will be output as well";echo"This spans\nmultiple lines. The newlines will be\noutput as well.";echo"Escaping characters is done \"Like this\".";//$b= 20;for($i=0;$i<5;$i++){$b+=$i;echo$b;echo'</br>';

}echo$b;?>

打上断点,然后

[flash=500,400]http://s1.knowsky.com/20160211/y43ctsupf2h29.png[/flash]

出现:

[flash=500,400]http://s1.knowsky.com/20160211/q5set4hjwhi29.png[/flash]

致此,我们可以愉快的开发了。

但是,这还是只能做个简单的单页DEBUG,我们需要进一步的配置XDEBUG

先修改php.ini,找到xdebug,修改为如下:

; XDEBUG Extensionzend_extension = "c:/wamp/bin/php/php5.4.12/zend_ext/php_xdebug-2.2.3-5.4-vc9-x86_64.dll"[xdebug]

xdebug.auto_trace=1

xdebug.collect_params=1

xdebug.collect_return=1

xdebug.trace_output_dir="C:/wamp/xdebug/trace"

xdebug.profiler_enable=1

xdebug.profiler_output_dir="C:/wamp/xdebug/profiler"

xdebug.remote_enable = on

xdebug.remote_handler=dbgp

xdebug.remote_host=localhost

xdebug.remote_port=9000

xdebug.profiler_enable = off

xdebug.profiler_enable_trigger = off

xdebug.profiler_output_name = cachegrind.out.%t.%p

xdebug.profiler_output_dir = "c:/wamp/tmp"

重启apache服务器 通过phpinfo()看到如下信息,证明配置成功:

[flash=500,400]http://s1.knowsky.com/20160211/ya0tszev10s29.png[/flash]

接下来可以运行项目进行调试了Debug Configurations可通过三种方式进入:1、右击需要调试的PHP文件,选择Debug As或者打开调试的PHP文件;2、选择菜单栏上Run菜单下的Debug As进入;3、点击菜单栏Run菜单下方小蜘蛛图标旁的向下箭头选择Debug Configurations。[flash=500,400]http://s1.knowsky.com/20160211/kh0jycxr1jw29.png[/flash]

三:导入现有项目

在d:/wamp/www有个项目,现在需要导入到我的Zend studio里面,Zend studio的workspace也是d:/wamp/www文件夹,所以我使用Local PHP Project或者PHP Project from Existing Directory都会出问题。

解决方法:

点击“File”-“NEW”-“Other”,在打开的对话框里选择“Genneral”-“Project”,然后在打开的对话框输入项目名称,就可以正常导入在workspace的项目了。3.1 PHP 支持通过以上方式导入,无法ctrl+左键 跳转 到函数源 代码这是因为把先前存在的工程以file的形式导入, zendstudio 就把工程当作文档来处理了。

解决的办法是:

右键点击工程->configure->add php support 然后系统会自动rebuild工程/workspace。

四:SVN

[flash=500,400]http://s1.knowsky.com/20160211/rbac0kmgvyt29.png[/flash]

[flash=500,400]http://s1.knowsky.com/20160211/vj3ch0m3rf030.png[/flash]

[flash=500,400]http://s1.knowsky.com/20160211/jp1ydq0zomk30.png[/flash]

[flash=500,400]http://s1.knowsky.com/20160211/jdd4mozb0cb30.png[/flash]

[flash=500,400]http://s1.knowsky.com/20160211/zz25gdv0agq31.png[/flash]

参考:

1:http://blog.csdn.net/imxiangzi/article/details/46533957

2:http://blog.csdn.net/imxiangzi/article/details/46533811

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有 導航