Pages

Wednesday, December 29, 2010

How to install PHP

Hello again :p
As I said yesterday, I will now teach you how to install PHP on your computer in a very very easy way. After my tutorial, you'll have everything you need to start writing your PHP docs, sites, whatever... So, let's start!

Tutorial on How to install PHP in your computer:

Step 1

- Go to google.com and search the keyword "xampp".











- Enter the first search result site: apache friends.

- Scroll down and select "XAMPP for Windows".
(if you have a different operating system, don't be shy, go for it! x) if you have linux select "XAMPP for linux" and so on...)















- Scroll down again and download the executable file (the installer).
















Step 2

Now that we're done with that, install the program you downloaded.
Note: let it install in C:/

After installing, open the XAMPP control panel.
It should look something like this:

















Do you have this? Cool!! Because you must have this after my whole explanation..
Now, push the start button right to the word Apache.
Now you should have something like this:
















Great. And now we are done with that. You may close that window because it won't really close the XAMPP. It will minimize it to an icon next to the clock and the other icons. Just like it is shown below. To make the window appear again, double-click the XAMPP control panel icon.




Step 3

You will now write a very simple PHP file to make sure everything's working.

Open a new notepad document. Type this:

<?php

echo "testing...";

?>

Stop typing! Copy only the red text to the notepad.
Now that you finished, go ahead and save the file to this location:
file:///C:/xampp/htdocs/


This is the correct location to save the .php files if you didn't change the XAMPP destination folder during the installation.

do not save it with the .txt extension. Save it with "xxx.php". If you have saved it as a .txt file already, go hurry and change it.

Note: If you don't have Mozilla Firefox installed in your computer install it. It's easy, just google it. For those who have no idea what that is, I think it would be better to quit this tutorial and go do something else. Mozilla Firefox is an internet browser just like Internet Explorer, Safari, Google Chrome or Opera.

Open Mozilla and type in the address bar:

http://localhost/xxxxx.php

 Note: xxx stands for the name you gave to the file. Replace the xxx for the name you saved it with.

And that's it. If you did everything I told you correctly, you browser should now display what you wrote in the .php file. In this case, we wrote "testing..." and it should appear in your browser just like so:











Note: I wrote a different text instead of "testing.."


So, that's the end of the tutorial. I hope this helped and hey! Now you can start programming you php files and other things!

No comments:

Post a Comment