PHP is a simple, secure, flexible, and efficient open-source language.
Standing for PHP Hypertext Preprocessor, it is the most used programming language worldwide.
Able to integrate into HTML, PHP handles the connection between your web pages and databases.
After installing Apache as a web server, and MySQL as a database system.
The scripting language, PHP, will process the code to display dynamic content to users.
First, always update Ubuntu’s package repository.
Why?
Because doing so will:
You’re probably wondering how to update your package repository by now.
Simply, type the following command into your terminal and press ENTER.
Then, put in your password and let Ubuntu do the magic work.
Don’t forget to check our tutorial on what is Ubuntu Linux and how to install it.
Installing PHP is a straightforward task.
Just, copy the below command and paste it into your terminal.
Press Y to confirm the latest PHP download and install.
Coming up, time to verify the PHP version after the installation.
Put in the command:
Well, you can see that, by the time of writing this article, the latest PHP version is 7.4.3
How to Install PHP on Ubuntu 20.04? Master the basics with this step-by-step "pictures included" guide, in less than 7 minutes! Share on XDid you know that it is possible to install PHP using Apache as well?
All you have to do is put in the following command:
For the changes to take effect immediately, you need to restart Apache using the given command:
Next, check and verify the Apache PHP module status by using the command:
Now that it’s up and running, you are on the right track!
To get a list of PHP extensions, you can enter the following command
Afterward, press the tab button on your keyboard twice, followed by Y, for a complete extensions list
For example, to install the cas extension, the command you need to enter would be:
The system will ask for the needed additional space to install the extension.
Press “y” to accept the process.
Momentarily, it will begin to download and install the extension you picked up.
This is the way you can download and run any of the available PHP extensions.
To test the configuration of your web server for PHP processing.
Create a new file named info.php inside var/www/html with the following command:
With the code:
<?php
phpinfo();
http://your_server_ip/info.php
.You will get the following webpage.
You can do it yourself, but you don’t have to!
Wave us hello at support@serverhub.com and let us guide you freely to your upcoming website.
Additionally, with 100% Uptime, 24/7 support, and 40GB interface connectivities.
ServerHub spans 9 locations and offers custom quotes
Check out our amazing deals starting from $5 a month!
That was the simplest-full guide to master the PHP basics on Ubuntu 20.04.
I’m sure that by now, you are a PHP professional yourself.
With learning how to install PHP, PHP extensions, and integrating them with Apache.
Let us discuss your thoughts and questions in the comments below so we can brainstorm, together!
This tutorial is a part of the LAMP stack guide series.
Check out the rest of the series:
How to install the latest Ubuntu Linux? Beginner’s guide
How To Install Apache On Ubuntu? The Comprehensive Guide
How To Install MySQL On Ubuntu? The Proven 2021 Guide
Overview of Proxmox VE: Open-source Virtualization Management Platform Proxmox Virtual Environment (VE) is an open-source…
Introduction to Oracle Database Oracle Database is a widely adopted relational database management system (RDBMS)…
Introduction to MySQL MySQL is one of the most widely used open-source relational database management…
Deep learning is a type of artificial intelligence that teaches computers to learn from large…
OpenSSH or Open Secure Shell is a powerful suite of tools that provides secure remote…
Virtualization has become a cornerstone of modern IT infrastructure in today's digital era. Among the…
This website uses cookies.
View Comments
It's really a nice and helpful piece of information. I am happy that you shared this useful info with us.
Please keep us up to date like this. Thanks for sharing.
Very great post. I just stumbled upon your weblog and wanted to mention that I've truly enjoyed browsing your weblog posts.
After all I'll be subscribing to your feed and I am hoping you write once more soon!