Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Wednesday, May 28, 2008

NetBeans 6.1 EA for PHP

Nice work by the people at Sun - there really is a NetBeans specifically for PHP. While I complained about missing support for a PHP plugin in 6.1 that was there in 6.0, one of my blog readers alerted me to this early availability release. Though, if you are used to NetBeans coming loaded with application/web servers, this version doesn't. But you can always install WAMP, which will provide the database, web services, and PHP engine for you.

To get NetBeans working with WAMP, the steps couldn't be easier:
  1. Create a new project in NB.

  2. Set where files should be copied to when you run the project.

  3. Make sure the Copy To Folder path points a web-accessible directory in WAMP, usually the www directory. So when you "run the project" in NB, files will be copied directly into the web server.
  4. Start the WAMP stack, and run the project. Should be accessible at http://localhost/TestApp (your substitues).
That's all there is. I like that NetBeans maintains the simplicity of developing PHP in this IDE. It's lightweight and poised to become a great development environment for all PHP scripting. I honestly had some trouble finding a [free] IDE for PHP development - that I liked, no strings attached.

.

Thursday, May 22, 2008

NetBeans Pulls PHP Plugin

In April, I mentioned that you could develop PHP in NetBeans 6.1. But at this writing, the plugin required has been quietly removed from NetBeans update/plugin centers. The search I describe in the article will only yield a jMaki plugin. This is disappoining because PHP developers would have liked using the scripting plugin for its pure orientation to PHP than jMaki that's a Java-oriented feature.
The plugin is not available for 6.1, but may be found for 6.0. Here's one reason to keep an older IDE around!

Saturday, April 12, 2008

Developing PHP On NetBeans

I'm finally making the move to developing in PHP - or at least I must for the time being because of an important project I am working on. To make things easy on myself, I need a familiar development environment - NetBeans 6.x is just perfect for that. Here's how you set up NetBeans to talk PHP.
  1. Ensure you don't have previous installations of PHP. Presence of such will confuse the hell out of your new installations.
  2. Download the Wamp server. This package contains an Apache HTTP web server, MySql database, and the PHP engine, along with some admin utilities and a Wamp server console. Believe me, this stack takes the nightmare out of configuring PHP on Windows.
  3. Download the PHP plugin for NetBeans: Tools | Plugins -> Available Plugins tab -> Search [php]. Install the PHP scripting plugin, which includes an editor, runtime, and documentation. We probably won't use the runtime that comes with this plugin, as we need to use Wamp and other debug tools that it does not support. NB will need to restart after this install.
After NB returns, test the setup by creating a simple PHP project:
  1. File | New Project ... -> PHP | PHP Project [Next] -> (set project properties) [Next].
  2. Web server configuration: click [Manage] -> Connection name = Wamp2, Local web server with file access [Next].
  3. Manual configuration [Browse] to %where_you_installed_wamp%\bin\apache\apache2.2.8\conf\httpd.conf for the Apache config file. [Next]
  4. Http server settings - just change the port number to something no other app is using. I choose 81 on localhost (Remember to update httpd.conf to listen on port 81 as well).
  5. Finish up and close the dialogs. NB creates a new project and opens index.php for you to edit. You can start wil basic HTML in a .php file. If on running the project you see a good page, all is well.
Note that you won't need to configure the web server every time you create subsequent projects. Also, I'll leave debugging and other configurations to future posts.