This lesson will bring you to the start of using PHP. In this one you will see where we need to place the files so the WAMP server can identify them and also the mode in which we will access them via web browser.

Don’t forget to subscribe to stay updated to our design news! Also take a minute to share this post with others using Social Bookmarks.

How to organize the files in the WAMP server

The WAMP server has been installed in “C:/wamp/” where we will go and will find the basic structure that the WAMP server will create after installation. Here we will find a folder named “www” – representing our working space, because the WAMP server finds it the main information folder. If we go in “C:/wamp/www” we will find a file named “index.php” – representing the file that the server access when we call it from a browser http://localhost/“. If we delete or replace the index.php file we lose the fast hyperlinks that the server offer us. I advice you from the begining not to delete or replace this file because you will have to access everything manual from your browser.

Accessing Files

Photo from Cumbu

To test the interpretation of the file on the server, we will open a browser web and enter http://localhost/index.php. Calling this we will be going to the main page of the server, the page that we accessed last lesson entering http://localhost/. I gave you this example to exemplify the fact that the server access the index files without specifing it.

Exercise 1

Enter in C://wamp/www/ folder and add a new folder named lesson1. Enter and create a new file calledpage.php – don’t write anything in this file. After this we access it from the browser enteringhttp://localhost/lesson1/page.php/. The browser will return a blank page because we didn’t write anything in page.php file. If case we type just http://localhost/lesson1/ the browser will show us a list with the files from lesson1 folder, because the WAMP server doesn’t find any file named index.

We will stop here with this lesson. In the next one I will give you some free applications to edit the .phpfiles.