Syllabus Schedule Project Labs Canvas Server Access phpMyAdmin Assignment 1 Assignment 2 Assignment 3 Assignment 4 Assignment 5 Assignment 6 Assignment 7 Assignment 8 Assignment 9

Server Access Instructions

Overview:

All MIS 314 students will be provided with accounts on the Yorktown server, which supports both the PHP language and mySQL database (Yorktown PHP configuration). For grading purposes your PHP code needs to be located on the Yorktown server. Yorktown is accessible both on- and off-campus via network drive mapping. Off-campus access requires the use of VPN (virtual private network) for secure access to WWU's network. Map Network Drive

PHP code may be edited with many different text editors and integrated development environments (IDEs). NetBeans is the recommended IDE for MIS 314. NetBeans is a free open-source product with several productivity enhancing features. These features include color coding, syntax checking, automatic indenting, type-ahead, documentation snippets, debugger, and FTP functionality. NetBeans is installed in the Parks Hall computer labs PH 210 & PH 47, CF 312 and CF 24.

The recommended configuration in MIS 314 is to edit your files directly on the server using Netbeans. Alternatively you may set up a development server on your personal computer and upload the completed files to Yorktown for grading.

If you prefer to use a different editor or IDE you are welcome to do so. Other possibilities include NotePad, WordPad, DreamWeaver, Expression Web, Visual Studio, and Eclipse.

Portable Applications:

NetBeans and Firefox (with FireBug) are both available as "Portable Applications" that can be run from a thumb drive, the U drive, or other storage media. This option may be handy when working on campus computers that do not have these applications installed. You may download Netbeans Portable Installer (v7.3) and run the installer. The installer will create a folder of files that you can run from a portable storage device, your U drive, laptop, etc.

First Time Setup:

  1. Map Network Drive to Yorktown: Map network drive
    1. VPN: (off campus only) A virtual private network connection is needed from off campus to access WWU's network. Establish a VPN connection by clicking here: https://securevpn.wwu.edu . The first time you open this link it will install a VPN client on your PC or Mac. Login using your WWU Universal username and password. Instructions for Linux users.
    2. Network drive:  A network drive connects your computer to the Yorktown web server. Follow ATUS instructions for Mapping Network Drives.

      The folder address for Windows users is:

      \\yorktown.cbe.wwu.edu\students\qtrCode

      For Mac users:

      smb://yorktown.cbe.wwu.edu/students/qtrCode

      where qtrCode is a three digit number. The first two digits are the year (ie. 16 for 2016) and the third is the quarter (1=winter, 2=spring, 3=summer, 4=fall). For instance, if the quarter is fall 2016

      you would enter: \\yorktown.cbe.wwu.edu\students\164

      If asked for a login, prefix your username with "wwu\" (eg. wwu\username).

      Once connected will see a single folder with your WWU user ID. This is the root folder for your web pages. Any files that you place inside this folder will be publically accessible via the Web. 

  2. Install NetBeans: Netbeans is a text editor for editing your php files. You may find that PortableApps is all you need. If so, skip this step. To install NetBeans on your PC or Mac go to the NetBeans download page. Select your operating system and the PHP download bundle. Check the download instructions if you have any problems.
     
  3. Create a NetBeans Project:
    1. You will need to create only one NetBeans project for MIS 314. All of your assignments and project will be located within folders inside the project. NetBeans
    2. Start NetBeans.
    3. Under the File menu select "New Project."
    4. In the "choose project dialogue box select "PHP" and "PHP Application" and click next.
    5. For "Name and Location" use any project name (MIS314code would be good).
    6. Source folder is your root folder on Yorktown. Click "Browse..." and under "Select Source Folder" click "computer." Select the Network Drive that you created previously, open the folder, select your root folder and click "open."  The source folder should be similar to:

      T:\qtrCode\Username"

      where T is the drive map on your machine (could be any letter), qtrCode is your 3-digit quarter code, and Username is your WWU username.
    7. Click Next.
    8. Under "Run Configuration" select "Local Web Site" and enter the project URL as:

      http://yorktown.cbe.wwu.edu/students/qtrCode/UserName

      where qtrCode is your 3-digit quarter code and UserName is your WWU username.
    9. Click Finish.
    10. You will see a new project icon under "Projects."
    11. Test Configuration: Test
      1. Open your new project, right-click on "Source Files," select "New," select "Php Web Page."
      2. For File Name type "index.php"
      3. Click finish
      4. Edit the new file by replacing
        "// put your code here" with:
        echo "Hello world";
      5. Right click on the file name and select "Run"
      6. This should open a new browser window with "Hello world."
      7. Success!

Opening an existing Project:

Once you have created a NetBeans project on subsequent visits you need only to open it. 

  1. If off-campus, create a VPN connection as described in step 1a above.
  2. Create a Network Drive map as described in 1b above.
  3. Start NetBeans. It will automatically attempt to open your existing project. If it is successful you can skip the following steps.
  4. Select "Open Project" on the File menu.
  5. In the dialogue box click "computer,' select your Network drive and navigate to your folder.
  6. Click open project.

Setting up a Development Server:

MIS 314 does not require a development server and it is not recommended for most students. Some students may prefer to have a development server since it supports use of the NetBeans debugger. When your code is completed you will need to upload it to Yorktown for grading. The following instructions are for those few students who want to configure a development server.

A PHP development server has four components:

  1. Integrated Development Environment
  2. Local Web Server: A web server on your local machine allows you to run the PHP code and see how it renders. Popular web servers are Apache (free open-source) and Microsoft's free IIS (Internet Information Server). Either is fine for this course.
  3. PHP engine: Required for the web server to execute your PHP code. MIS 314 uses PHP version 5.
  4. Debugger (optional): Debuggers allow you to step through code one line at a time and view the values of the variables while the code is executing. NetBeans supports the XDebug debugger.

Two methods are described below for setting up a development server on your PC. The first uses Portable apps, the second does a full install. Portable Apps is the easier approach.

1. Setup Web server using Portable Apps

  1. Download the Netbeans Portable App (link above) and unzip to the root folder such as C:, U:, etc.
  2. Download XAMPPlite.zip and unzip it into the same root folder as Netbeans. (they can also be put on a thumb drive).
  3. Open the xampplite folder and start xampp_control.exe. Start Apace (see image to right).
  4. Xampplite creates a web root folder at YourDrive:xampplite\htdocs where "YourDrive" is the letter of your drive.
  5. Start Netbeans. You should see a project named "PortableProject." Right-click on the projet name and select "Properties" (see image)
  6. Change the drive letter from "U:" to your drive letter. Click OK
  7. Inside Netbeans Source Files folder you should now see some files. Right-click on "index.php" and select run. It should open the file in the browser. The url should read:"http://localhost/index.php" and you will see the php output in the browser.
  8. You now have a development server running on your machine. For help google the phrase "xampplite portableapps."

2. Full install of a development server on your PC or Mac:

  1. Install NetBeans IDE.
  2. Install a web server and PHP. These instructions describe how to install IIS on Windows since this is the easiest option. You are welcome to use Apache or any other web server. Chapter 2 of Nixon explains how to setup a WAMP (Windows, Apache, mySQL, PHP) or MAMP stack and provides debugging tips.
    1. Check the programs on your PC and see if it has Microsoft Web Platform Installer. If not download it from Microsoft and install it. localhost
    2. Start Platform Installer and select the Web Platform tab. Select the first link "Web Server." A green check mark indicates that IIS will be installed.
    3. "Frameworks and Runtimes" is just below Web Server. Click the "customize" link and select "PHP 5.2.xx. " Click the "Install" and "I accept" buttons. Sit back and relax.
    4. Test IIS and php.
    5. The default web root folder for IIS is located at C:\inetpub\wwwroot.  Use Notepad to create a file named "test.php" and in the file put the code <?php echo "Hello World!" ?>
    6. Open a web browser and enter the address: http://localhost/test.php. "Localhost" is "this computer."  You should see a web page with "Hello World!" This confirms that both IIS and PHP are working correctly.
    7. Trouble shooting: Windows 7 may complain that you do not have permission to save files in the Inetpub folder. One solution is to give yourself permission on the folder.
      Another problem is a 404 page not found error. Check that your file is named correctly.

  3. Point NetBeans to the web root folder.
    1. Start NetBeans
    2. under the "File" menu select "New Project..."
    3. Under "Choose Project" select "PHP" and click the Next button.
    4. Give your project a name like "MIS314".
    5. For "Source folder" browse to "C:\inetpub\wwwroot" and click the Finish button.
    6. The MIS314 project folder will be displayed.
    7. Modify the Project URL since it needs a small modification.
      • Right click on the MIS314 project
      • select "Properties,"
      • select "Run Configuration,"
      • change "Project URL" to http://localhost/ and click OK.
    8. Test the configuration
      • Open the subfolder "Source Files." You should see your file "test.php."
      • Right click on "test.php" and select "Run." The file should open in your default web browser.
    9. View your PHP configuration using the PHPINFO() function.
    10. The "Source files" folder contains a file "phpinfo.php." If it doesn't then create it.
    11. Add the following code to the file <?php phpinfo(); ?>
    12. Save the file, right click on it, select "Run."
    13. The output from this function displays the configuration for PHP on your machine.
  4. Install XDebug
    1. A debugger is not needed for MIS 314. Debuggers are useful for code that is more complex than anything we will write. If you would like to install it follow the instruction at Xdebug.org.
    2. Your php.ini file will need the following lines (Windows):
         zend_extension="C:/Program Files (x86)/PHP/php_xdebug-2.1.0-5.2-vc6-nts.dll"
         xdebug.remote_enable=On
         xdebug.remote_host="localhost"
         xdebug.remote_port=9000
         xdebug.remote_handler="dbgp"
    3. To restart IIS: click Start --> Control Panel --> Administrative Tools --> IIS Manager. Double click IIS Manager. Click the first option in the right panel "Restart."

Look under Tutorials and Articles for your operating system.

Regular Expressions HTML Color Names Color Picker ASCII Character Codes Unicode Character Codes