Develop and Deploy a PHP Application with NetBeans

 

Follow these instructions to use Netbeans to develop and deploy your PHP application to the OEF Hosted Environment.

Before you begin:

  • Obtain your OEF Hosted Environment URL, username, and password from your coach.
  • Make sure you have unrestricted Internet access and that proxy servers or firewalls are not blocking access to the below-noted resources.

Install the Software

Download and install the following software. Accept the default components for each install.

Configure BitKinex WebDAV Client

Create a new WebDAV connection to the OEF Hosted Environment:

  • Open BitKinex. The first time you open BitKinex you will need to answer network setup questions based on your internet connection.
  • In the main window, go to Data Source > New > Http/WebDAV.
  • Enter the name for this connection. In this example, we name the connection "ThinkQuest".

    BitKinex - New Webdav connection

In the "Server" window, enter your OEF Hosted Environment URL, username and password:

  • In the "Server address" field, enter the OEF Hosted Environment URL. In this example, we use "xxddtjwifeogcqgavnwa.thinkquest.org".
  • From the "Security" dropdown list, select the "SSL" option.
  • In the "Authorization" section, enter the OEF Hosted Environment username and password.

    BitKinex - Server settings

Enter the OEF Hosted Environment folder for deployed PHP files:

  • Go to Server > Site Map from the options on the left.
  • In the "Path" column of the table, click the slash (/).
  • Enter "/upload/php/" in the text box below the table.
  • Click "Update". The default path will change to "/upload/php/".
  • Click "OK". The WebDAV connection to the OEF Hosted Environment is now configured.

    BitKinex - Webdav settings

Test the WebDAV connection to the OEF Hosted Environment:

  • In the main BitKinex window (see the image the start of this section), double-click the "Http/WebDAV" connection you created previously. In this example, the connection is "ThinkQuest".
  • BitKinex will connect to the OEF Hosted Environment. You will see the server folders on the left (ThinkQuest) and your local folders on the right (My Computer). Initially, the server folders will be empty.
  • All files and folders associated with your PHP application must be uploaded to the /upload/php/ folder.

    BitKinex - Test Webdav connection

Create your Application

Create a new project for your PHP application using NetBeans:

  • Open NetBeans.
  • Create a new Project. Go to File > New Project.
  • Select "PHP" under Categories.
  • Select "PHP Application" under Projects.
  • Click "Next".

    NetBeans - New PHP Project

Name your project:

  • In the "Project Name" field, enter a name for your project. In this example, we name the project "HelloWorld".
  • In the "Sources Folder" field, enter the folder on your local computer where you want to store PHP files. In this example, we use the location "C:\ThinkQuest".

    NetBeans - Project settings

Select the Frameworks you want to use in your application. This example does not use them so none is selected.

  • Click "Finish".

A new project will appear in the project list (Window > Projects).

  • Your project will contain a pre-created index.php file. This is the starting page of your PHP application which you must modify. Below is an example of how to modify this page.

    NetBeans - default index.php file

Edit the index.php file:

  • Enter (or copy/paste) the following example code:
    <!DOCTYPE html>
    <html">
    <head>
    <title>HelloWorld</title>
    </head>
    <body>
    <?php
    Print "Hello World!";
    ?>
    </body>
    </html>

Deploy your Application

Locate the source files of your PHP application on your local computer:

  • Open BitKinex.
  • Double-click the "Http/WebDAV" connection to the OEF Hosted Environment. In this example, the connection is "ThinkQuest".
  • In the "My Computer" window, open the "Sources Folder" where the NetBeans IDE stored your PHP project files. In this example, the location is "C:\ThinkQuest".

    BitKinex - Local drive

Deploy the source files to the OEF Hosted Environment:

  • In the "My Computer" window, select the files and folders you want to deploy.
  • In the "ThinkQuest" window, select the php folder.
  • Move the selected files from the "My Computer" window to the "ThinkQuest" window using the left arrow button.

    BitKinex - Remote server

Your application is deployed and can run in a browser. In this example, the application URL is:

  • https://xxddtjwifeogcqgavnwa.thinkquest.org/php/display/