Knowledgebase
emscom > emscom Help Desk > Knowledgebase

Search help:


Install Netbeans for PHP development on Windows

Solution

1. Download the Netbeans installer apache-NetBeans14.exe, with pre-packaged JDK18 from Codelerity
https://www.codelerity.com/netbeans/

2. Run the installer and configure for previously installed NGinX PHP (see Knowledge Base article).

3. Start a new PHP project

File>New Project>PHP>PHP Application

  • Project Name: phptest
  • Sources Folder: c:\dev\www\phptest
  • PHP Version: 7.4
  • Default Encoding: UTF-8

Click Next

  • Run As: Local Web Site (running on local web server)
  • Project URL: http://localhost/phptest/

Click Finish

4. Configure Netbeans

  • Tools>Options>General
    • Web browser: firefox
    • Click Test Connection
  • Tools>Options>PHP>General
    • PHP Interpreter (CLI) : c:\dev\php\php.exe
    • Open Result In Output Window: enabled
  • Tools>Options>PHP>Debugging
    • Debugger Port: 9003
    • Session ID: netbeans-xdebug
    • Resolve Breakpoints: enabled

5. Create a new PHP source file named index.php and Run to test Netbeans is configured

 <!doctype html>
<head>
    <meta charset="UTF-8">
    <title>Hello PHP</title>
    <style> h1{ color:#6699CC; font-family: Tahoma, Verdana, Segoe, sans-serif; font-size:18px }</style>
</head>

<?php
    $version_string = phpversion();
    echo "<h1>Hello PHP $version_string World<h1>";

 

6. Download the appropriate XDebug dll from https://xdebug.org/download

  • Copy php_xdebug-2.9.8-7.4-vc15-x86_64.dll to c:\dev\php\ext\php_xdebug.dll

7. Check the php extensions directory is set correctly in php.ini

; Directory in which the loadable extensions (modules) reside.
;extension_dir = "ext"
extension_dir = "c:\dev\php\ext" 

8. Enable XDebug by adding the following section to php.ini

[XDebug2]
zend_extension=c:\dev\php\ext\php_xdebug.dll
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.client_port=localhost
xdebug.remote_port=9003
xdebug.idekey="netbeans-xdebug"

9. In Netbeans add a breakpoint to the index.php file and use the Debug button to check XDebug is correctly configured

 

<check php/ext path is correct in php.ini>

<check xdebug module activein phpinfo>

 

 
Was this article helpful? yes / no
Related articles Install PHP composer
Install NGinX and PHP on Windows
Disable NLA on XP Remote Desktop Client
Article details
Article ID: 182
Category: Dev
Date added: 19-06-2022 19:07:19
Views: 654
Rating (Votes): Article not rated yet (0)

 
« Go back

 
Powered by Help Desk Software HESK, in partnership with SysAid Technologies