![]() To create a new PHP project, navigate to File -> New Project and choose PHP Application from the list of options. When complete, fire up the newly installed IDE to begin exploring its PHP capabilities! Creating a PHP Project All you need to do is set execute permissions on the downloaded file, and run it from the command line to begin the installation process. Instead, you’ll also need to download the Linux installer from the NetBeans Website. Incidentally, for you Ubuntu users like me, as of this article’s publication date version 6.8 is not available via Ubuntu’s repositories. You can choose the PHP-specific bundle, or select the All option to download the version that bundles universal support for all languages. Next, you’ll be prompted to choose from several available downloads, as NetBeans supports multiple languages, including C, C , Java (FX, ME, and others), PHP and Ruby. You can easily install the NetBeans IDE using a platform-specific installer found at, so point your browser there and click the Download button on the home page. In this article I’ll introduce the NetBeans IDE from a PHP developer’s perspective, highlighting the key features that can make you a more productive PHP developer. Although support for PHP didn’t come until the 6.5 release (November 2008), it’s already fast becoming one of the PHP community’s most popular IDE choices. An open source project fostered by Sun Microsystems (now Oracle) for more than a decade, NetBeans has grown from a Java-specific solution to a powerful development ecosystem supporting multiple languages and hundreds of extensions (known as plugins to the NetBeans community). I am sure you checked it 10 times but who knows.For millions of developers around the globe, the NetBeans IDE is their code editor of choice. Read that!Ĭheck the xdebug.ini parameters match the Netbeans ones. If you copied my documentation, there should be a logging file, inside your docker, at the location: /tmp/xdebug.log. in a place which is considered by your PHP executable. If you don't run your project with the php command, be sure (by displaying a phpinfo() for example) that the xdebug.ini is applied, e.g. You can display them from the Window | Debugging menu if they don't show up automatically. The most useful commands to me are the following one (step into, go to next instruction etc.)Īnd the Variables and Call Stack panels. The command will stop, and Netbeans will be stop at the required line. In your docker launch a PHP command, like php bin/phpunit. Place a breakpoint somewhere in your application, as early as possible (or use the Stop at first line option provided by Netbeans, as visible in the screenshot above).īreakpoint (red square) set at line 63 here In Netbeans, click on the following icon (or ctrl F5): Make these parameters match the xdebug.ini config in your docker, as visible on the picture (fields Debugger Port and Session ID) If it looks OK, carry on, otherwise fix your config first. Xdebug.remote_log => /tmp/xdebug.log => /tmp/xdebug.log You will see such an output, reflecting your configuration (and the configuration used the next time you use the php command): In your docker, check your xdebug parameters are properly set by using the command php -i | grep xdebug. Otherwise, xdebug will be stuck inside your docker and unable to talk to the Host, where Netbeans sits. It means that the xdebug.remote_host=127.0.0.1 will also be the host IP. The line -network=host is also very important. This parameter needs (also?) to be an environment variable, so don't forget it. The line -env XDEBUG_CONFIG=\"idekey=my-ide-key\" is kind of duplicate of the xdebug.ini configuration xdebug.idekey="my-ide-key". ![]() ![]() If not, Netbeans will stop but will be unable to show you the actual line. Your project file names and directories inside your container must be the same as your host architecture. The line -v /home/me/dev/project:/home/me/dev/project is also very important. ![]() The idekey will be used in Netbeans as well as the remote port. I highly suggest to use a remote_log parameter, because if it fails, it's where you'll have valuable data. These are the required minimal configuration. ![]()
0 Comments
Leave a Reply. |