0% found this document useful (0 votes)
32 views

2 Installing PHP

The document discusses how to install PHP through installing an AMP stack. It describes several options for AMP stacks on different operating systems, including WAMP for Windows, LAMP for Linux, and MAMP for Mac. It then provides steps to download and install XAMPP, a cross-platform AMP option, on Windows. The steps guide the user to download XAMPP, allow changes during installation, select components, choose an installation folder, and start the Apache and MySQL servers to run PHP programs on localhost.

Uploaded by

krisneltancingco
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

2 Installing PHP

The document discusses how to install PHP through installing an AMP stack. It describes several options for AMP stacks on different operating systems, including WAMP for Windows, LAMP for Linux, and MAMP for Mac. It then provides steps to download and install XAMPP, a cross-platform AMP option, on Windows. The steps guide the user to download XAMPP, allow changes during installation, select components, choose an installation folder, and start the Apache and MySQL servers to run PHP programs on localhost.

Uploaded by

krisneltancingco
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Installing PHP

To install PHP, we will suggest you to install AMP (Apache, MySQL, PHP) software stack. It is
available f or all operating systems. There are many AMP options available in the market that
are given below:

o WAMP f or Windows
o LAMP f or Linux
o MAMP f or Mac
o SAMP f or Solaris
o FAMP f or FreeBSD
o XAMPP (Cross, Apache, MySQL, PHP, Perl) f or Cross Platform: It includes some
other components too such as FileZilla, OpenSSL, Webalizer, Mercury Mail, etc.

If you are on Windows and don't want Perl and other f eatures of XAMPP, you should go f or
WAMP. In a similar way, you may use LAMP f or Linux and MAMP f or Macintosh.

Download and Install WAMP Server


Click me to download WAMP server

Download and Install LAMP Server


Click me to download LAMP server

Download and Install MAMP Server


Click me to download MAMP server

Download and Install XAMPP Server


Click me to download XAMPP server

How to install XAMPP server on windows


We will learn how to install the XAMPP server on windows platform step by step. Follow the
below steps and install the XAMPP server on your system.

Note: Make sure to turn of f your antivirus and other malware protection software. Set your
UAC to the lowest level.
Step 1: Click on the above link provided to download the XAMPP server according to your
window requirement.

Step 2: Af ter downloading XAMPP, double click on the downloaded f ile and allow XAMPP to
make changes in your system. A window will pop-up, where you have to click on
the Next button.
Step 3: Here, select the components, which you want to install and click Next.
Step 4: Choose a f older where you want to install the XAMPP in your system and
click Next.

Step 5: Click Next and move ahead.


Step 6: XAMPP is ready to install, so click on the Next button and install the XAMPP.
Step 7: A f inish window will display af ter successful installation. Click on the Finish button.

Step 8: Choose your preferred language.

Step 9: XAMPP is ready to use. Start the Apache server and MySQL and run the php
program on the localhost.

How to run PHP programs on XAMPP, see in the next tutorial.


Step 10: If no error is shown, then XAMPP is running successfully.
CREATING AND RUNNING YOUR FIRST PHP CODE

STEP 1) CREATING YOUR “HELLO WORLD” PHP


SCRIPT
If you have properly installed XAMPP, then the root folder for the HTTP
documents will be located at XAMPP/htdocs. Simply start by creating your “hello
world” PHP script there.
XAMPP/htdocs/hello.php
<?php
echo "Hello World!";

STEP 2) FIRING UP XAMPP

Next, fire up the XAMPP Control Panel, and this is where you can switch the
components on or off. Usually, we will only need the Apache web server and
MySQL database server – So turn those on.
STEP 3) “RUN” FROM BROWSER

Finally, open your browser and navigate to http://localhost/hello.php –


Congratulations! You have successfully installed a web server stack and run
your first PHP script.

EXTRA) CHANGING THE HTTP ROOT FOLDER

Don’t like the default root folder? You can change it by editing a few lines of
configuration. Go to the XAMPP Control Panel, hit the config button, and
choose “Apache httpd.conf”. Look for the document root section, and change
it to wherever you like.

httpd.conf
#DocumentRoot "D:/xampp/htdocs"
#<Directory "D:/xampp/htdocs">
DocumentRoot "D:/http"
<Directory "D:/http">

You might also like