PHP is one of the most popular server scripting languages used for creating dynamic pages. Many popular CMS is written in PHP including, WordPress, Laravel, Magento, and many more.
Install the openssh-server in order to perform an installation of the SSH server on your Ubuntu 20.04. First, log in to your Ubuntu 20.04 server via SSH as the root user: ssh root@IPAddress -p Portnumber. You will need to replace ‘IPAddress’ and ‘Portnumber’ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.
- An Ubuntu 20.04 VPS (we’ll be using our SSD 2 VPS plan) Access to the root user account (or access to an admin account with root privileges) Log in to the Server & Update the Server OS Packages. First, log in to your Ubuntu 20.04 server via SSH as the root user: ssh root@IPAddress -p Portnumber.
- Download Ubuntu 20.04 ISO Image. Use the following link to download the Ubuntu 20.04 live server install ISO image, which is provided only for 64-bit systems. Ubuntu-20.04-live-server-amd64.iso; After downloading the ISO image, you need to create a bootable DVD using Rufus tool or a bootable USB drive using the Unetbootin LiveUSB Creator.
The PHP 7.4 version was officially released on November 28th, 2019 with a number of new features. It has also few incompatibilities so you should take care before upgrading from the previous version.
In this tutorial, we will show you how to install PHP7.4 with Nginx on Ubuntu 20.04 server.
Prerequisites
- An Ubuntu 20.04 VPS (we’ll be using our SSD 2 VPS plan)
- Access to the root user account (or access to an admin account with root privileges)
Log in to the Server & Update the Server OS Packages
First, log in to your Ubuntu 20.04 server via SSH as the root user:
You will need to replace ‘IP_Address‘ and ‘Port_number‘ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.
Before starting, you have to make sure that all Ubuntu OS packages installed on the server are up to date. You can do this by running the following commands:
Install Nginx
By default, the latest version of Nginx is available in the Ubuntu 20.04 default repository. You can install it with the following command:
After installing Nginx, start the Nginx service and enable it to start at system reboot with the following command:
You can also verify the installed version of Nginx using the following command:
You should get the following output:
Install PHP7.4
By default, Ubuntu 20.04 ships with PHP 7.4 in its upstream repositories. You can install it easily by just running the following command:
Once the PHP is installed, verify the installed version with the following command:
You should get the following output:
PHP configurations related to Nginx is stored in /etc/php/7.4/fpm/php.ini file. You can modify it for better performance.
Install PHP7.4-FPM and Other Extensions
Nginx does not contain native PHP processing. So you will need to install PHP-FPM for processing the PHP files. FPM is an alternative PHP FastCGI implementation with some additional features useful for heavy-loaded sites.
You can install PHP7.4-FPM with other necessary extensions by running the following command:
Once all the packages are installed, start the PHP7.4-FPM service and enable it to start at system reboot:
Configure Nginx to Process PHP Files
Next, you will need to configure Nginx to process PHP files.
To do so, create a new Nginx virtual host configuration file with the following command:
Add the following lines:
Save and close the file then enable the Nginx virtual host configuration file with the following command:
Next, verify the Nginx for any syntax error with the following command:
You should get the following output:
Finally, restart the Nginx service to apply the configuration changes:
Next, create a info.php file to verify the PHP version:
Add the following code:
<?php phpinfo();
Save and close the file when you are finished.
Verify PHP
At this point, Nginx is configured to process PHP files. Its time to test it.
Open your web browser and type the URL http://test.example.com
. You should see the following screen:
In the above page, you can check the PHP7.4 version, installed PHP extensions, PHP configuration options etc.
Of course, you don’t have to do any of this if you use one of our Nginx VPS Hosting services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.
Apache Maven is a powerful project management tool used for projects build, dependency and documentation. It is based on POM (project object model) that helps you to manage an entire project’s build process, including storing documents, reporting and more. It has built-in objective commands to deal with the packages and code composition. It is designed to build and manage Java based project by proficiently documenting and reporting the central project related information.
In this tutorial, We will explain how to install Apache Maven on Ubuntu 20.04.
Prerequisites
- An Ubuntu 20.04 VPS (we’ll be using our SSD 2 VPS plan)
- Access to the root user account (or access to an admin account with root privileges)
Step 1: Log in to the Server & Update the Server OS Packages
First, log in to your Ubuntu 20.04 server via SSH as the root user:
You will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.
Before starting, you have to make sure that all Ubuntu OS packages installed on the server are up to date. You can do this by running the following commands:
Step 2: Install Java
Apache Maven is based on Java. So you will need to install Java in your system. You can install it with the following command:
Once installed, verify the Java version with the following command:
You should get the Java version in the following output:
Step 3: Install Apache Maven from Source
In this section, we will show you how to install Apache Maven from the source. This way you can install the latest version of Apache Maven in your system.
Download Apache Maven
First, download the latest version of Apache Maven to the /opt directory with the following command:
Once the download is completed, extract the downloaded file with the following command:
Next, rename the extracted directory with the following command:
Setup Environment Variable
Next, you will need to setup environment variable to define the Java and Apache Maven path. To do so, create a new file named apachemaven.sh inside /etc/profile.d/ directory:
Add the following lines:
Save and close the file then give the execution permission:
Next, activate the environment variable with the following command:
Verify the Apache Maven
Now, you can verify the Apache Maven installation using the following command:
If everything is fine, you should get the following output:
Step 4: Install Apache Maven From APT
You can also install the Apache Maven from the Ubuntu 20.04 default APT repository.
First, update the repository cache with the following command:
How To Install Ssh On Ubuntu 20.04
Once your repository is up-to-date, you can install the Apache Maven using the following command:
Enable Ssh Ubuntu 20.04 Raspberry Pi
After installing the Apache Maven, verify the Apache Maven installation using the following command:
You should get the following output:
Congratulations! you have successfully installed Apache Maven on Ubuntu 20.04 VPS.
Of course, you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.