Class

Projects

  • Free MP3s on Last.fm

Sponsors

Installing PHP on our computer using XAMPP

Printer-friendly versionPrinter-friendly versionSend to friendSend to friend

Installing PHP on our computer using XAMPP

PHP

What is php?

PHP is a scripting language that is generally used to combine front end technologies like HTML and CSS to backend technologies such as a MySQL database. PHP can be used to send email from a form, generate dynamic downloadable files, and retrieve system and network data from users on your website. PHP is a very powerful tool with a lot of online support.

What do I need to use php?

To run PHP, three things are needed: the php program, A web server, and a web browser. The last one is easy, your web browser is simply whatever you are using to access the web: Firefox, Internet Explorer, Safari. If you have your website hosted, then that is your webserver and PHP may already be installed. If you don't want to go through the steps of installing PHP on your computer, you can always just write your code, upload it to your website, and test it out.

What we will be doing is using the program XAMPP to install the web server and PHP software on our computer for us. What this will do is treat our computer as a web server (With some advanced techniques we could even host websites from our own computer if we wanted!)

XAMPP

What is XAMPP?

XAMPP stands for:
X (Cross Platform)
A (Apache Web Server)
M (MySQL)
P (PHP)
P (Perl)

So while we won't be working with the programming language Pearl, it does install all the other things we need to start writing our code. The installation can be a bit tricky for beginners, but the first thing we need to do is actually download xampp.

http://www.apachefriends.org/en/xampp.html

On this page you should find an area to download the program depending on your system (XAMPP for Mac / Windows..) For this example we will be using windows. Click the windows link and then under download click the main link for XAMPP. This will take you to a list of downloads, we want to download the EXE Basic Package.

Once your file has downloaded, run it. It will ask you where you want to install XAMPP, and leaving it as the C:\ folder should be fine so just click install. On the next screen you can leave the desktop icons checked, if you want this to run automatically everytime you start your computer, you can install Apache and MySQL as a service.

You will then see all the files being extracted and transfered that need to be. Once it is complete it should ask if you want to open up the xampp control panel, click yes.

From the control panel you can start and stop the Apache / MySQL programs from running when you aren't using them. Make sure Apache and MySQL is started and running.

To test that everything is running correctly, in your web browser address bar type: http://localhost

This should bring up a screen XAMPP screen, if so then everything is working correctly.

To write php there is a special folder you need to add your files to in order to test them out. Wherever you installed XAMPP at, there will be an XAMPP/htdocs folder. Inside this folder you will make a folder for your website, ie "ACME". Inside that folder is where all of your website files will go. So your website files would be located at:

C:\XAMPP\htdocs\ACME

and you can view your website in your browser by going to

http://localhost/ACME

You can either always work inside the htdocs folder, or you can work in the folder you normally would and when you are ready to view / test out your work, copy the files to your htdocs folder.You can set this up automatically in dreamweaver in your website management screen, where your connection type is Local and navigate to the htdocs/ACME folder, then check the box to upload on save.

You are now ready to start writing some php code!

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.