Use NetBeans and Eclipse to develop PHP applications (1 ). [Php100 exclusive article] if you look at the market share of NetBeans and Eclipse separately, you may think that using any of the IDE to develop PHP applications is okay, for example: [php100 exclusive article] if you look at the market share of NetBeans and Eclipse separately, you may think that using any of the IDE to develop PHP applications is okay, for example:
2. Eclipse: it is an open-source project built on Equinox OSGi. Eclipse is evolving from Java IDE and supports more and more languages, including static and dynamic languages and thick clients, thin client and server framework, modeling and business reports, embedded and mobile development. It is currently the best Java IDE.
NetBeans 6.5 for PHP
Eclipse PDT or Eclipse PDT 2.0
Java Development Kit (JDK) version 5 or 6
For MySQL 5.0
Apache HTTP Server 2.0
Introduction to NetBeans IDE 6.5 for PHP
Starting from NetBeans, I first downloaded netbeans,1from http://www.netbeans.org/downloads/index.html. During installation, you only need to follow the instructions in the installation wizard.
Figure-1 download NetBeans IDE 6.5 for PHP: click PHP on the NetBeans download page
You only need to install the Java Runtime Environment (JRE) to run NetBeans for PHP. you do not need to install the complete JDK. The latest version of NetBeans IDE for PHP is 6.5, which includes the following new features:
1. PHP source code editor
2. remote and local project development
3. simplified code navigation
4. PHP debugging (you can check local variables, set monitoring points, breakpoints, and evaluate code flexibility). NetBeans IDE for PHP also allows you to use XDebug and select any debugger version, however, XDebug 2.0 is recommended for better compatibility with PHP 5.0.
5. MySQL integration
Create a PHP project
To implement a PHP script/Web application, you need to create a PHP Project root (an empty project, including only common files and directories ). Regardless of the application, IDE generally uses the concept of "Project". NetBeans provides a dedicated wizard for configuring a new project. follow these steps to create a booksPHP sample application:
1. start NetBeans;
2. Select File à to create a new project (a new project dialog box is displayed );
3. select PHP from the category panel, select a PHP application from The Project panel (you can also choose to load a PHP application), and click next;
4. in this dialog box, enter the project name and location. enter booksPHP here, select a convenient location in the source folder field, and click next;
5. NetBeans supports running PHP applications on local servers (usually Apache HTTP Server), remote servers (via FTP), or PHP scripts (using PHP interpreter) run. for comparison, you should run the booksPHP application under Apache HTTP Server. Therefore, select a local Web site from the list, and then enter the application URL in the project URL field area, the URL is usually similar to http: // localhost /... in this example, it should be http: // localhost/php/booksPHP/(of course you need to make appropriate adjustments to this URL for your configuration ), because you plan to run the project on the local server, you need to provide a running location for NetBeans to copy the application code there and select "Copy from source folder to another location ", in the copy to area, specify the target location (for example, C: Program FilesApache GroupApache2htdocsphpbooksPHP). Obviously, this is only required when the project root folder and local server root folder are different;
6. click "finish" to close the "new project" dialog box.
If you choose to run the PHP application in script form, you can specify the position of the PHP interpreter (php.exe). Similarly, if you choose to run the PHP application on the server in a distance, you must specify a valid FTP connection, upload directory, and upload method.
So far, NetBeans has generated the project, as shown in figure 2.
Figure-2 generated project: after the new project Wizard is completed, the generated project root is displayed in NetBeans IDE.
Create an HTML interface
Most of the HTML code of this project resides in index. index. php is automatically created when a project root is created by NetBeans. you can use the NetBeans Palette tool to add HTML elements to it. if you do not see this tool, click the à Palette menu in the window, palette provides shortcuts for all major HTML elements and selects elements by dragging them.
Before adding some labels, NetBeans requires you to specify special configurations for them. for example, when you drag
Listing 1 HTML code (index. php)
Token problem, for example :...
You have to specify the number of rows and columns before using tags. I will not detail them here. Creating HTML code in NetBeans is as loose as walking in the park. Therefore, use the Palette and drag element to modify index. php. The final result is shown in listing 1.