国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home Backend Development PHP Tutorial [分享]怎么使用XDebug+NetBeans IDE 搭建PHP開(kāi)發(fā)調(diào)試環(huán)境

[分享]怎么使用XDebug+NetBeans IDE 搭建PHP開(kāi)發(fā)調(diào)試環(huán)境

Jun 13, 2016 pm 12:30 PM
nbsp netbeans php remote xdebug

[分享]如何使用XDebug+NetBeans IDE 搭建PHP開(kāi)發(fā)調(diào)試環(huán)境
初學(xué)PHP開(kāi)發(fā),由于一直未能搭建一個(gè)可以Remote?Debugging的環(huán)境,導(dǎo)致開(kāi)發(fā)效率異常低下。

被MS慣壞了的我,顯然無(wú)法習(xí)慣這種記事本+IE?Explorer的開(kāi)發(fā)模式。因此決定搭建一個(gè)可以進(jìn)行Debug的PHP開(kāi)發(fā)環(huán)境。

閱覽多方資料后我決定使用NB+XDebug來(lái)搭建環(huán)境。由于搭建環(huán)境之步驟稍顯繁瑣,特此記錄以備忘。?

?

1,首先去下載NetBeans,目前最新版是NetBeans?7.0,注意選哪個(gè)帶有PHP插件的。

為了方便起見(jiàn),我下載的是包含了Full?Features的版本。

給個(gè)鏈接:

http://netbeans.org/downloads/start.html?platform=windows&lang=zh_CN&option=all

?

2,下載你需要的XDebug的版本。

2.1?準(zhǔn)備工作

在此之前確保你裝上了xampp,?也就是一個(gè)PHP和Apache,MySql,Perl的整合套件。目前最新版本是1.7.4?Final。這里也給出一個(gè)下載鏈接

http://www.newhua.com/soft/50127.htm

?

2.2?測(cè)試XAMPP安裝情況

???????如果一切就緒,瀏覽器輸入http://localhost:80看是否正確安裝Apache,PHP。

???????可以使用phpInfo()查看PHP特性安裝情況。

2.3?安裝XDebug

XDebug只是PHP的一個(gè)Extension。去XDebug的官網(wǎng)下載即可。

這里也給出一個(gè)下載地址

http://xdebug.org/download.php

?

注意的是,這里版本眾多,如何選擇需要再次開(kāi)啟瀏覽器,查看phpInfo函數(shù)的輸出。根據(jù)PHP版本,PHP?Build環(huán)境(VC6?or?VC9),是否是Thread?safe(TS)來(lái)選擇一個(gè)合適的XDebug的版本即可。

?

3,XDebug的配置。

???????修改PHP.ini?的XDEBUG?Section。

???????需要確保開(kāi)啟幾個(gè)配置選項(xiàng),一般來(lái)說(shuō)建議開(kāi)啟如下幾個(gè)選項(xiàng)。

???????zend_extension=”XDebug的路徑”

例如”zend_extension=/php/ext/php_xdebug-2.1.0-5.2-vc6.dll”

??????xdebug.remote_enable=on
??????xdebug.remote_handler=dbgp
??????xdebug.remote_host=localhost
??????xdebug.remote_port=9000???//默認(rèn)是9000?建議該一下

然后重啟Apache的服務(wù)。在phpInfo中查看XDebug?Section下的配置項(xiàng)。

?

???????說(shuō)明,?貌似XAMPP中的PHP.ini已經(jīng)整合了XDebug只不過(guò)注釋起來(lái)了。我們所要做的就是去掉注釋即可。

4,NetBeans中Debug。

???????進(jìn)入NetBeans,新建一個(gè)PHP項(xiàng)目,編寫PHP代碼。

???????然后使用”調(diào)試”菜單下的設(shè)置斷點(diǎn),步入(Step?into),?步過(guò)(Step?over)等MS的IDE常見(jiàn)的菜單功能項(xiàng)。

???????斷點(diǎn)斷住之后,你還能看到諸如Watch,Local等查看變量值的Window。是不是感覺(jué)很過(guò)癮,從此開(kāi)發(fā)PHP程序就可以告別簡(jiǎn)單的記事本+瀏覽器模式。擁有一個(gè)足以媲美VS開(kāi)發(fā)環(huán)境的PHP?IDE。更重要的是,這一系列工具都是免費(fèi)的。

Statement of this Website
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

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How do I stay up-to-date with the latest PHP developments and best practices? How do I stay up-to-date with the latest PHP developments and best practices? Jun 23, 2025 am 12:56 AM

TostaycurrentwithPHPdevelopmentsandbestpractices,followkeynewssourceslikePHP.netandPHPWeekly,engagewithcommunitiesonforumsandconferences,keeptoolingupdatedandgraduallyadoptnewfeatures,andreadorcontributetoopensourceprojects.First,followreliablesource

What is PHP, and why is it used for web development? What is PHP, and why is it used for web development? Jun 23, 2025 am 12:55 AM

PHPbecamepopularforwebdevelopmentduetoitseaseoflearning,seamlessintegrationwithHTML,widespreadhostingsupport,andalargeecosystemincludingframeworkslikeLaravelandCMSplatformslikeWordPress.Itexcelsinhandlingformsubmissions,managingusersessions,interacti

How to set PHP time zone? How to set PHP time zone? Jun 25, 2025 am 01:00 AM

TosettherighttimezoneinPHP,usedate_default_timezone_set()functionatthestartofyourscriptwithavalididentifiersuchas'America/New_York'.1.Usedate_default_timezone_set()beforeanydate/timefunctions.2.Alternatively,configurethephp.inifilebysettingdate.timez

How do I validate user input in PHP to ensure it meets certain criteria? How do I validate user input in PHP to ensure it meets certain criteria? Jun 22, 2025 am 01:00 AM

TovalidateuserinputinPHP,usebuilt-invalidationfunctionslikefilter_var()andfilter_input(),applyregularexpressionsforcustomformatssuchasusernamesorphonenumbers,checkdatatypesfornumericvalueslikeageorprice,setlengthlimitsandtrimwhitespacetopreventlayout

What is data serialization in PHP (serialize(), unserialize())? What is data serialization in PHP (serialize(), unserialize())? Jun 22, 2025 am 01:03 AM

ThePhpfunctionSerialize () andunserialize () AreusedtoconvertcomplexdaTastructdestoresintostoraSandaBackagain.1.Serialize () c OnvertsdatalikecarraysorobjectsraystringcontainingTypeandstructureinformation.2.unserialize () Reconstruct theoriginalatataprom

How do I embed PHP code in an HTML file? How do I embed PHP code in an HTML file? Jun 22, 2025 am 01:00 AM

You can embed PHP code into HTML files, but make sure that the file has an extension of .php so that the server can parse it correctly. Use standard tags to wrap PHP code, insert dynamic content anywhere in HTML. In addition, you can switch PHP and HTML multiple times in the same file to realize dynamic functions such as conditional rendering. Be sure to pay attention to the server configuration and syntax correctness to avoid problems caused by short labels, quotation mark errors or omitted end labels.

What are the best practices for writing clean and maintainable PHP code? What are the best practices for writing clean and maintainable PHP code? Jun 24, 2025 am 12:53 AM

The key to writing clean and easy-to-maintain PHP code lies in clear naming, following standards, reasonable structure, making good use of comments and testability. 1. Use clear variables, functions and class names, such as $userData and calculateTotalPrice(); 2. Follow the PSR-12 standard unified code style; 3. Split the code structure according to responsibilities, and organize it using MVC or Laravel-style catalogs; 4. Avoid noodles-style code and split the logic into small functions with a single responsibility; 5. Add comments at key points and write interface documents to clarify parameters, return values ??and exceptions; 6. Improve testability, adopt dependency injection, reduce global state and static methods. These practices improve code quality, collaboration efficiency and post-maintenance ease.

How do I execute SQL queries using PHP? How do I execute SQL queries using PHP? Jun 24, 2025 am 12:54 AM

Yes,youcanrunSQLqueriesusingPHP,andtheprocessinvolveschoosingadatabaseextension,connectingtothedatabase,executingqueriessafely,andclosingconnectionswhendone.Todothis,firstchoosebetweenMySQLiorPDO,withPDObeingmoreflexibleduetosupportingmultipledatabas

See all articles