Home  >  Article  >  php教程  >  使用Netbeans进行PHP开发

使用Netbeans进行PHP开发

WBOY
WBOYOriginal
2016-06-06 20:02:191817browse

如今编译器真的很多,用来编写PHP脚本的从zendstudio到记事本。都可以。我一般使用Notepad,简单方便,安装xdebug也可以进行良好的调试,没有使用过xdebug。 但是用过netbeans之后,觉得netbeans用来编写Php脚本真的很不错,内置很多功能,包括git,和单步断

如今编译器真的很多,用来编写PHP脚本的从zendstudio到记事本。都可以。我一般使用Notepad,简单方便,安装xdebug也可以进行良好的调试,没有使用过xdebug。

但是用过netbeans之后,觉得netbeans用来编写Php脚本真的很不错,内置很多功能,包括git,和单步断点调试功能,非常实用。


其他的功能大家可以去试试了,主要说下调试的配置,这也是我喜爱netbeans的主要原因之一:


php.ini文件xdebug下面配置如下:

xdebug.remote_enable = on

xdebug.remote_handler=dbgp

xdebug.remote_host=localhost
xdebug.remote_port=9000


9000对应netbeans选项的调试 端口 。必须一致。


php.ini 配置文件 的output_buffering=off 


修改过后重启apache服务。


关于单点登录的PHP文件调试:(比如调试:http://test.cy0551.com/iwebshop/index.php?=controller=ucenter&action=index)


1):右击项目属性,弹出项目属性窗口,如下设置:

   使用Netbeans进行PHP开发


2):打开ucenter.php文件,在index函数中设置断点。


3):启动项目调试,f8多次,f7进入IWeb::createWebApp($config)->run(); 直到执行到run函数,f7进入,然后f7或ctrl+f7跳出,直到执行到uncenter.php文件,就可以调试了。


Netbeans默认编辑是最严格的审核机制,变量未声明或者格式错误等等都会在右边的状态栏显示出来,有时看起来很别扭,如果不需要,可以在 工具=》选项=》提示里面配置。具体的方法就是打开对应的文件,比如一个html文件,进行配置。


快捷键:alt+q隐藏左边导航,alt+shift+D停靠显示


netbeans优化性能:

http://stackoverflow.com/questions/229763/how-to-improve-netbeans-performance

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn