How to install PHP on Ubuntu 18.04 or Linux

How to install PHP on Ubuntu 18.04 or Linux

We will discuss How to install PHP on Ubuntu 18.04 or Linux. Its a programming language, PHP was officially launched in 1994 and designed by legendary programmer Rasmus Lerdorf and his team.

What is PHP?

In this article We will discussed about installation guide, How to install PHP on Ubuntu 18.04 or setup PHP on Ubuntu 18.04 or Linux machine. Recent new PHP upcoming version 8.4 release date is initial months of 2021. Current version of PHP 7.4  which release on 28 Nov 2019 and supported till 2022. And about version PHP 8.0 it will support until 2024.

.

Get your own Team save 70% cost

Best software developer agency coresumo
Best software development agency coresumo

How to install PHP on Ubuntu 18.04 or Setup on Linux machine

There are two method to install PHP on Ubuntu machine

Method 1. How to install PHP on Ubuntu 18.04 (Linux) with MySQL
Method 2. Install PHP, MySQL and Apache server via package on Ubuntu 18.04

.

Top 10 Most Popular Programming Languages (2004/2020)

Method 1. How to install PHP on Ubuntu 18.04 (Linux) with MySQL

Step 1. Install apache

$ sudo apt-get install apache2
Copy

Press Y for conformation

Step 2. Install MySQL

$ sudo apt-get install mysql-serverCopy

Press Y for conformation

NOTE: before going forward secure mysql server and test, it working properly or not

Secure MySQL:

$ sudo mysql_secure_installation
Copy

Testing MySQL:

$ sudo mysql -u root -pCopy


Create database name:

$ Create database myfirstdb
Copy

Step 3. Install Php

$ sudo apt-get install php libapache2-mod-php
Copy

Test PHP


$ sudo nano /var/www/html/info.phpCopy

Paste following code:

<?php
phpinfo();
?>Copy

Step 4. Restart Apache server:

$ sudo systemctl restart apache2
Copy

Open the browser run this url

111.111.111.111/info.phpCopy

You will see output after this

.

Most Popular Backend Frameworks (2012/2020)

Method 2. Install PHP, MySQL and Apache server via package on Ubuntu 18.04

Click here to download the complete package for the same.

.

Conclusion:

Newcomers and other programmers still think, PHP is not a good language. But this is not true.

Because:

  1. More over 60% website are using PHP as backend
  2. Big brands like Wikipedia, Facebook, Hootsuite using PHP even NASA using it.
  3. Nothing is perfect every language has its own capability just like human fingers. They are not all the same.
  4. Every backend language have their own features:

Like:

  • Speed: NodeJS
  • Faster development: Ruby
  • Secure: Java
  • High performance: C, C++, Rust
  • Data analysis: Python
  • All in one: PHP

Wanna know about:
PHP 8.0 vs PHP 7.4 and PHP 8.0 features performance benchmark – Click here
PHP 7.4 vs 7.3 PHP 7.4 vs 7.3 What is the PHP 7.4 benchmark and PHP 7.4 features?- Click here

.

Other latest blogs

Similar articles – How to install PHP on Ubuntu 18.04 or Linux

  • best WordPress plugin for SEO SEM Optimization – Click here
  • How to Increase Maximum upload file size WordPress 2 MB to TB or terabyte import unlimited – click here
  • PHP 8.0 vs PHP 7.4 and PHP 8.0 features performance benchmark install setup – Click here
  • WordPress Fill the form and PDF sent on Email using Contact Form 7 – Click here
  • How to fix hidden plugin editor on WordPress 2020 | I can’t find my plugin editor- Click here
  • GTmetrix VS Pingdom VS Google PageSpeed Insights VS Lighthouse Best performance optimization- Click here
  • How to install wordpres on local machine like window 10 linux and Mac – Click here

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top