This document describes how to configure the NetBeans PHP project for WordPress. This project is very useful for developers who are developing WordPress and its extensions, and for those who want to debug or just study wordpress code.
Note: The scenario described in this document assumes that all resources (WEB servers, databases, PHP resources) are available on the local development machine. In the case of remote development, the project configuration may be different.
Get WordPress Resources
WordPress resources can be obtained from http://wordpress.org/. Just point your browser to http://wordpress.org/download/and download the latest version (the latest version of this article is v2.6).
Download the. zip or. tar.gz package and extract it to a location (for example,/home/<yourname>/sources/). The resource will be extracted to the WordPress subdirectory.
Install NetBeans
Download and install the NetBeans IDE 6.5 for PHP. You can get the latest development version from the following websites:
http://bits.netbeans.org/download/trunk/nightly/latest/
or use the beta (Milestone 2) version (when it is available).
Download the. zip or. tar.gz package and extract it onto the drive (for example,/home/<yourname>/sources/).
Configuring the WEB server and PHP
Make sure that you have installed and run the Apache WEB server on your system. You also need to configure the PHP runtime and XDebug extensions. Depending on your development platform, the configuration steps may be different. Please refer to the PHP Learning resources configuration for your PHP development environment section.
Configure MySQL
Make sure that you have installed and run the MySQL server on the system. If you do not have MySQL, please refer to the MySQL website to learn how to get and set up the database server on your development platform.
After you have the server running, you need to create a database for WordPress. You must also create a user who can create tables in the database and insert and select data.
CREATE DATABASE wordpress;
GRANT ALL ON wordpress.* TO 'wordpress'@'localhost' IDENTIFIED by 'secret';
In this example, we created a database called WordPress and a user named WordPress, whose password is secret. You can choose a different name and password for your project.
Create a project in NetBeans
Now that you're all set, let's start by creating a WordPress project in NetBeans.
Start NetBeans. When the IDE appears, create a new PHP project (File | New Project-> php;php application with Existing Sources).
Click Next.
In the Sources Folder field, type or select the directory (/home/honza/sources/wordpress) where you previously unzipped the WordPress resource.
Select the project name (WordPress).
We do not want to confuse the original source file with the project metadata created by NetBeans, so choose put NetBeans metadata into a separate folder (place the NetBeans metadata in a separate folder) option and type the path to the directory (/ home/honza/netbeansprojects/wordpress).
Click the Next button.