How to install PHP in windows, Linux or in Mac OS.

How to install PHP

To develop in PHP the first need is to install PHP, and in this post, we will learn how to install PHP in windows, Linux or in a mac os. It is needed to make your local machine as a local server as can be developed and tun PHP code in your local machine opening through http://localhost/

The first step is to gather information about your machine,

you need to know about your machine or computer before starting the installation of PHP, the point to mark is as described below,

* the os ruing in your computer.
* the bit of operating system.
* If your machine is windows you must check whether there is .net framework installed, if not then please install.
* you have to remember that you have to install Apache, MySQL, and PHPMyAdmin in your machine.

How to install PHP in your windows and mac machine?

There is two most popular application available for windows machine to install PHP, and they are xampp server and wamp server.

to download xampp please go to https://www.apachefriends.org/download.html
and to download wamp go to https://www.wampserver.com/en/#download-wrapper

select your operating system and the bit you want to install.

after download please double click on the xampp or wamp.

after installation xampp and wamp both will create some folder in your selected drive.

wamp will create [Drive]->wamp->www, the www folder is the folder where your PHP application will be stored.
xampp will create [Drive]->xampp->htdocs, the htdocs folder is the folder where your PHP application will be stored.

How to install PHP in Linux operating system.

In this step, we are going to see how to install PHP in a Linux operating system. To install PHP first need to open the terminal or comment promptly. and then first need to install Apache then needed to install PHP MySQL and at last needed to install PHPMyAdmin.

the command line is given below, please do follow the command and instructions to install PHP.

The first step to install Apache’s first login as a super admin in your machine.

-> then write the command
# apt-get install php5-common libapache2-mod-php5 php5-cli
-> please follow the steps to install apache.
-> then stop and then start the apache by following the comments
-> the comments are
# /etc/init.d/apache2 stop
# /etc/init.d/apache2 start

Then install the additional PHP 5 packages,

-> write the command to install the additional PHP 5 packages,
# apt-cache search php5
# aptitude search php5
# aptitude search php5 |grep -i mysql

Then install PHP with MySQL and cURL

-> to install PHP with MySQL and cURL please write the command line in your terminal of Linux.
# apt-get install php5-mysql php5-curl

Now the finale steps to install PHPMyAdmin.

-> to install PHPMyAdmin follow the steps and command given below.
# apt-get update
# apt-get install phpmyadmin php-mbstring php-gettext

Then must restart Apache by following the given command line
# /etc/init.d/apache2 stop
# /etc/init.d/apache2 start

*** sometime there may be needed to give sudow before apt-get to install the applications.

How to install PHP

How to install PHP

I hope you have installed PHP in your machine, please write a comment to make the site better and more useful.

Thanks for reading.

Share The Post On -