RU beehive logo ITEC dept promo banner
ITEC 325
2017spring
ibarland

homelectshws
D2Lbreeze (snow day)

running-php-via-web
running php on rucs
(not using a web server)

We will look at:


How to connect to rucs

Linux Review

You'll want to be familiar with the main options for the following:

If you want to brush up (or, learn) basic unix, this is a good tutorial (sections 1,2 on using the command-line for file basics, and section 5 for file permissions).

Accessing rucs

Before we even revisit the code, let's talk about rucs (“radford university computer science”; it's a machine managed by the ITEC department, not the campus IT division):

splitting into multiple files

Video: require_once (18m47s)

We can take blend.php (src), and separate the code from the test-cases: utils.php (src), and separately utils-test.php (src). The directive require-once is a run-time instruction which just goes to the require'd file and (effectively) splices it into the current file, and continues evaluating line-by-line. (So it's reminiscent of java's import, but require-once significantly more simple-minded. Beware trampling on identifiers, and it's poor practice to have any dangling tags / code in the require'd file.)

This also lets us separate a program that uses blend from the test cases: some-web-page.php (src), and some-web-page.php (output).


Running a php file via the web

Video: running php via web (23m26s)
Note:This is not to be used for hw01. (That's intentional: Before having a web-server configured to run your programs, you should be clear on how to run your programs without using the web at all, for debugging purposes.)

Recall that when a web-server gets a request, it decides how to respond. For php.radford.edu, some of the configuration rules:

Let's put our php program on the web!

Here is a quick check-list of common problems, if you try running your program via the web but get an error:


XHTML

xhtml: Even though original HTML doesn't require the following, they are best practices, and they are required for this class:

See also:

homelectshws
D2Lbreeze (snow day)


©2017, Ian Barland, Radford University
Last modified 2017.Feb.19 (Sun)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Rendered by Racket.