- Make sure you have read and setup the required directories and permission as described in FAQ section on Prerequisites for hosting a web page on cse.unl.edu.
- Change your working directory to the public_html directory.
> cd ~/public_html
- Open a command line session to cse.unl.edu.
- Use an editor like vi or pico to create the index.php file. Refer to the FAQ pages on editors on cse.unl.edu. Pico being the simple Unix editor to use.
> pico index.php
- Use the editor to insert some HTML into the file, a simple HTML content is shown below.
<html> <head> <title> This is my first page </title> </head> <body> <h1> My first page</h1> <?php echo "<p>Hello World </p>" ?> </body> </html>
- Save the file and return to the command line.
- Grant everyone (others) read access to the file you just created.
> chmod o+r index.html
- Open a browser and point it to: http://cse.unl.edu/~login/index.php and you should see the file you just created.
- If you get an error, tail the /var/log/apache2/error_log (the tail command shows any new lines added to a file) while you try to access your page to see if there are any errors. If you don't see errors in error_log, you should tail /var/log/apache2/suphp.log as well and then try to access your page again to see if any errors are reported.
> tail -f /var/log/apache2/error_log
- If you still can't get your PHP program working, see if the student resource center can be of any assistance or send an email to support@cse.unl.edu and someone will help you identify the problem.
Active:
Yes
FAQ Priority:
5.00
FAQ Category:
Web Related