Web and PHP pages on uoregon.edu

Your uoregon account supports php pages. If you want to copy your pages from the students.oregonebiz.com server to the uoregon server, here are the steps. (You can see why we use the oregonebiz.com server for class :) ).

1. Set up your uoregon account for web pages. The UNIX command line instructions are available at http://cc.uoregon.edu/webpageunix.html. If you would prefer to use a graphical user interface (GUI) rather than a unix command line, here are the steps. It requires the SSH secure file transfer client, available from the duckware CD.

(a) Open the SSH Secure file transfer client application

(b) Connect to your uoregon.edu account (Host: uoregon.edu)

(c) Create a folder called public_html in the remote view (right column)

(d) Right click on the new public_html folder and click on properties.

(e) Check the following permissions:
         Owner: Read, write, execute
         Group: Read, execute
         Other: Read, execute
      The permission mode should now be 755. Click OK

2. In Dreamweaver or your preferred web page editor, add the following line to the top of every PHP page:

#! /usr/local/bin/php
This line must go BEFORE everything else. Don't leave any spaces or blank lines before this line.
It must go before your <?php include "header.php"; ?> line if you have one. You can't simply put it in include header.php once because this line tells the server where the php application is (and you need PHP to interpret the include line).
3. Upload your pages to the public_html folder using either Dreamweaver or the SSH Secure File Transfer Client. If your using Dreamweaver, the remote info is:
FTP Host: shell.uoregon.edu
Folder: public_html
Username: your uoregon username (same as email)
Password: your uoregon password (same as email)
Use Secure FTP (SFTP) must be checked.
4. Back in the SSH secure file transfer client, you must set permissions for each PHP page. The steps and permissions are the same as those described at (e) above except you need to right click on the php file (or files) instead of the public_html folder.
Your URL is http://www.uoregon.edu/~username (so long as your homepage is index.html)

5. Because uoregon.edu is a Unix server, you might need to check your links. Unix is case senstive (unlike Windows). For example, linking to index.php is different to linking to Index.php

6. If your php pages don't work, it could be because line breaks (what happens when you press Enter) are different in Windows and Unix. To fix this problem in Dreamweaver:
(a) Go to Edit --> Preferences --> Code Format
(b) Change Line Break type to LF (Unix)
(c) Click OK.
If you're not using Dreamweaver, open up the SSH Secure Shell Client, change to your public_html directory (chdir public_html) and use the following command:
 
cat old.php | col -b > new.php
Good luck! If you want to use mySQL with your PHP pages, my recommendation is to go with a web hosting company such as godaddy. The uoregon server doesn't really support mySQL databases.
References: http://hr.uoregon.edu/davidrl/php.ppt (especially for noting the Dreamweaver preference option and Unix command for line breaks).
Published Tuesday, January 02, 2007 12:31 PM by gcastner
Filed under:

Comments

No Comments