NetBeans IDE PHP Quick Start Tutorial (network pack)

Source: Internet
Author: User
Tags php debugger php development environment php download netbeans
NetBeans IDE PHP Quick Start tutorial (Web grooming)

Directory

    • Component Installation
    • Set up PHP projects in the NetBeans IDE for PHP
    • Run the first PHP project
    • Using the database server in the NetBeans IDE for PHP
    • Next steps

to learn this tutorial, you need the following software and resources.

software or resources required version
NetBeans IDE php download package
php engine version 5
web server The recommends using Apache HTTP Server 2.2.
php debugger XDebug 2 .0 or later

You can install either the PHP engine, the WEB server, and the database separately, or you can use the AMP (Apache, Mysql, PHP) package.

Installation and Configuration

The following document contains a description of one or both methods of setting up the PHP Web stack on the operating system. These instructions are not authoritative. The Web stack is made up of third-party software, and because your environment may be different, you may want to set up PHP with other AMP packages or other methods. You may need to supplement our instructions with your own research.

    • Configuring the PHP development environment in Windows
    • Configuring the PHP development environment in the Ubuntu Linux distribution
    • Configuring the PHP development environment in Mac operating system (Mac OS X)

Set up PHP projects in the NetBeans IDE for PHP

For help with installing and starting NetBeans IDE, see the installation documentation.

To start developing a PHP application in the NetBeans IDE for PHP, you first need to create a project. This project contains information about the location of the project file and how the application is run and debugged (run configuration).

  1. Start the IDE, switch to the Projects window, and then choose File > New Project (newly created). The Choose project (select project) panel opens.
  2. In the Categories (category) list, select PHP.
  3. In the Projects (project) area, select PHP Application (PHP application) and click Next. The "Name and location" Panel of "New PHP Project" is opened.
  4. In the Project Name text field, enter newphpproject.
  5. In the Sources folder field, browse to your PHP document root directory and create a subdirectory named Newphpproject here. The WEB server looks for files to open in the browser from the document root folder. The document root directory is specified in the WEB server configuration file. For example, for Xampp, the document root directory is xampp_home/htdocs.
  6. Leave all other fields at their default values. Click Next. The Run Configuration window opens.
  7. In the "Run as" drop-down list, select Local Web site. The project will run on the local Apache server. Other options will run the project remotely via FTP and run on the command line.
  8. Leave the project URL (item URL) as the default value.
  9. Click Finish. The IDE will create the project.
Learn more aboutSet up PHP projects in NetBeans for more information.

Run the first PHP project

  1. Launch the IDE and select File > Open Project. ". The Open Project dialog box opens.
  2. Select newphpproject, and then click Open Project. Displays the Newphpproject tree in the Projects window and opens the index.php file for the project in the editor and Navigator Navigator window.
  3. Enter The following code inside the BLOCK:
    echo "Hello, world! This is my first PHP project! ";
  4. To run the project, place your cursor over the "Newphpproject" node and select "Run" from the context menu. Shows what you should see in the browser window:

    Congratulations! Your program can run properly!

Using the database server in the NetBeans IDE for PHP

You can use a variety of database servers in the NetBeans IDE for PHP, but the most common are MySQL servers. can be fromHere to download.
Note: The recommended version for this product is MySQL Server 5.0.
See also:
    • Setting up a MySQL database server in the Windows operating system
    • Creating a sample database with test data
    • MySQL and NetBeans IDE
    • Connect to MySQL Database
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.