How to install PHP in windows, linux or mac ?

How to install PHP in windows, linux or mac ?


Published at - Aug 13, 2021

To begin with PHP development it is required to install PHP in our local system to compile the PHP code. There is open-source software which is providing PHP development environment. Some of them are –

For windows – Wamp, Xampp

For linux – Lamp, Xampp

For mac os – Mamp, Xampp

Install wamp in windows – Wamp (Windows Apache Mysql Php) is used to create a development environment in windows. To get started with the wamp we need to download wamp form it’s official website https://www.wampserver.com/en/ and clicks on the download section. Please ensure to download the correct version of WAMP according to your system architecture (32 bit or 64 bit).

Wamp download page

Once the wamp is downloaded you can install it like any other software in the Windows.

Root directory – c:/wamp/www/

Install xampp in windows – Xampp is a cross-platform software for PHP, MySQL, Apache and Perl development. To getting started with Xampp on windows it is required to download and install it first for its official website https://www.apachefriends.org/download.html from XAMPP for Windows tab. Please ensure to download the correct version of WAMP according to your system architecture (32 bit or 64 bit).

Xampp for windows

Once the xampp setup is downloaded you can install it like any other software in the Windows.

Root directory – c:/xampp/htdocs/

Install xampp in Linux (ubuntu) – To install Xampp on Linux we need to download the setup form its official website https://www.apachefriends.org/download.html from Xampp for Linux.

Then we need to open a terminal in the downloaded location. I am assuming the installer is downloaded in Downloads dir.

  1. Open terminal by pressing alt+ctrl+t
  2. Change location cd /home/{user}/Downloads
  3. Change permission by sudo chmod xxx-installer.run
  4. Launch setup wizard ./xxx-installer.run
  5. Follow the on-screen instruction to install.

Root directory – /var/www/html

Install lamp in Linux (ubuntu)

  1. Update packages before begin sudo apt-get update
  2. Install Apache2 apt-get install apache2
  3. Install PHP sudo sudo apt-get install php libapache2-mod-php php-mcrypt
  4. Install Mysql sudo apt-get install mysql-server libapache2-mod-auth-mysql php-mysql

Root directory – /var/www/html

Install xampp in MAC os – Xampp is a cross-platform software for PHP, MySQL, Apache and Perl development. To getting started with Xampp on mac it is required to download and install it first for its official website https://www.apachefriends.org/download.html from XAMPP for Os X tab. Please ensure to download the correct version of WAMP according to your system architecture (32 bit or 64 bit).

Once the xampp setup is downloaded you can install it like any other software in the Mac.

NOTE : For future tutorails I am going to use LAMP on Ubuntu.





About author

Harendra
Harendra Kanojiya

Hello, I am Harendra Kumar Kanojiya - Owner of this website and a Fullstack web developer. I have expertise in full-stack web development using Angular, PHP, Node JS, Python, Laravel, Codeigniter and, Other web technologies. I also love to write blogs on the latest web technology to keep me and others updated. Thank you for reading the articles.



Follow Us

Follow us on facebook Click Here

Facebook QR
Scan from mobile
Join our telegram channel Click Here
Telegram QR
Scan from mobile