Jump to content

Creating, Saving and Recalling Script


Lineman

Recommended Posts

Have just installed PHP5 on my computer which runs a Linux OS.

Now i want to start learning. I have just made a simple HTML page with:

 

<?php

print "Hello World! <br>";

print "Hello World!";

?>

 

Would someone like to explain how and where i might save the HTML file and how to recall it so that i can view the contents. Thanks

Link to comment
https://forums.phpfreaks.com/topic/99331-creating-saving-and-recalling-script/
Share on other sites

You need to save it with the php extension within your apache document root. You should be able to find this by issuing...

 

grep ServerRoot /etc/apache2/httpd.conf

 

Either that or locate the httpd.conf file manually. Some distros put things in different locations. What distro are you using?

 

From there, you simply need to call http://localhost/scriptname.php from your browser.

I have installed via a terminal:

 

1) apache2,

2) php5,

3) mysql-server,

4) php5-mysql.

 

I am running Ubuntu "Gutsy Gibbon 7.10".

 

After installing the above i typed: http://localhost into the Web browser's address bar and saw a page with, apache2-default on it.

 

I did manage to navigate to where the apache2-default folder is located and when i opened it clicked on an html file called index.html and was rewarded with the text "It works"?

 

Have saved an html page with an .php extension but i can't work out how to place it in the apache2-default folder.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.