You are viewing a read-only archive of the Blogs.Harvard network. Learn more.

Basic LTI Tutorial Using PHP

Download Our Code

To get you up and running, we provide you with a Vagrant file and Puppet manifesto to set up your virtual machine (both were generated by the GUI at PuPHPet), as well as a Basic LTI library written in PHP (originally found through the Edu Apps Writing LTI Stuff page, but, apparently, no longer available). To download this code, you will need to clone it using Git. First, create and change into a directory where you want to stash the code. Once you do so, type in the following command:

git clone https://github.com/Harvard-ATG/workshop-lti-basic.git

This will download everything from the Git repository and store it in a folder called workshop-lti-basic.

Start Up Your Virtual Environment

Once you have downloaded the code, change into the workshop-lti-basic folder:

cd path/to/workshop-lti-basic

In this directory, you should see several files and folders, including the LICENSE file, the README.md file, a .git folder, and a demo folder. Run the following commands:

cd demo
vagrant up

Now you wait. And wait some more. And continue waiting as your virtual environment downloads and fires up.

ACK!What’s all this waiting for? What the Heck is going on? If you are new to Vagrant and VirtualBox, the command vagrant up does the following things:

  1. Determines if you have the virtual machine that is specified by this tutorial; if not, Vagrant downloads the virtual machine for you and installs it.
  2. After the virtual machine is installed, Vagrant boots it up in the VirtualBox environment;
  3. During the bootup process, several scripts are run to see if your virtual machine has the appropriate software; if not, this software, including an Apache2 web server and PHP, are downloaded and installed in your virtual machine.

All of this downloading and installing takes a great deal of time.

As your virtual environment downloads and installs, a tremendous number of log messages and warnings will fly by your screen. Monitor or ignore them as you see fit. Be patient, and the process will eventually return you to the command line. Maybe it’s time to get another cup of coffee or refreshing beverage. . .

ACK! I got a nasty error message, and my VM won’t install. What should I do? Good question. It really depends on what the error message is. Try Googling it using the keywords “Vagrant” and “VirtualBox” in the search parameters. That might give you a hint.

Once you are back on the command line, and no errors have occurred, this means that you have your virtual machine up and running, complete with a web server and PHP engine!

Test Your Virtual Environment

Open your favorite web browser and type the following into the address bar:

http://localhost:8080/

You should see the following appear in your browser window:

tlt_lti_screenshot_index

Success! You are running your LTI web server. You can see a sample LTI-compliant LMS running here:

http://localhost:8080/lms.php

tlt_lti_screenshot_lms

Don’t fill out anything or press any buttons yet. It’s now time to review where you are and what you have.

Pages: 1 2 3 4

Comments are closed.