Skip to content

2. Setting up a development environment

The scripts were written and tested in the following environment:

  • an Apache web server / MySQL DBMS / PHP 5.3 environment called WampServer.
  • the NetBeans 7.0 development IDE

2.0.1. Installing WampServ

WampServer is a package that combines several software components:

  • an Apache web server. We will use it to write web scripts in PHP
  • the MySQL database management system
  • the PHP scripting language
  • a MySQL database administration tool written in PHP: phpMyAdmin

Wamp Server can be downloaded (as of July 2011) at the following address:

http://www.wampserver.com/download.php
  • In [1], download the appropriate version of WampServer
  • The installation creates the directory structure shown in [2] and [3]
  • In [4] and [5], the PHP installation folder

2.0.2. Installing the NetBeans 7.0 IDE

The NetBeans 7.0 IDE can be downloaded from the following address (July 2011):

You can download either the full version [1] or the PHP-only version [2], which is lighter. Once NetBeans is installed and launched, you can create your first PHP project.

  • In [1], select the File / New Project option
  • In [2], select the [PHP] category
  • In [3], select the project type [PHP Application]
  • In [4], give the project a name
  • In [5], choose a folder for the project
  • In [6], select the downloaded PHP version
  • In [7], select UTF-8 encoding for PHP files
  • In [8], select the [Script] mode to run PHP scripts in command-line mode. Select [Local Web Server] to run a PHP script in a web environment.
  • In [9,10], specify the installation directory for the PHP interpreter from the WampServer package.
  • Select [Finish] to complete the PHP project creation wizard.
  • In [11], the project is created with an [index.php] script
  • In [12], write a minimal PHP script
  • In [13], run [index.php]
  • In [14], the results appear in the NetBeans [output] window.
  • In [15], a new script is created
  • In [16], the new script

The reader can create all the scripts that follow in the same PHP project.

Now that the development environment has been set up, we can cover the basics of PHP.