Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
No Result
View All Result
Home Google Cloud

Install PHP 7.4 on Ubuntu 18.04

by Cloudbooklet
4 years ago
in Google Cloud, Compute Engine
Install Php 7.4 On Ubuntu
ShareTweetSendShare
ADVERTISEMENT

Install PHP 7.4 on Ubuntu 18.04. This guide let you learn how install the latest PHP version 7.4 on your Ubuntu system or your Ubuntu server on any VPS or any Cloud or any Dedicated hosting and configure it with Apache and Nginx.

The latest PHP 7.4 version is officially released on November 28th, 2019. It comes with a number of new features and a few incompatibilities that you should be aware of before upgrading from the previous version.

This installation is tested on Google Cloud Platform with a Compute Compute Engine VM Instance. This set up will work on all Linux servers.

ADVERTISEMENT

Prerequisites

  1. A Ubuntu server set up with sudo privileges.
  2. Completed the initial Ubuntu server setup.

If you are using Google Cloud Platform to install PHP you need the following steps to be done.

You might also like

How To Install Git On Ubuntu 20.04

How to Install Git on Linux

4 months ago
Vector Image

DataStax Enhances Astra DB on Google Cloud with Vector Search Capability

4 months ago
  1. A running Compute Engine, see the Setting up Compute Engine Instance with Ubuntu 18.04.

Here are some cloud hosting providers you can choose from with very low cost and free trial.

Getting Started

Make sure your Ubuntu server is having the latest packages by running the following command.

ADVERTISEMENT
sudo apt update
sudo apt upgrade

This will update the package index and update the installed packages to the latest version.

Add PPA for PHP 7.4

Add the ondrej/php which has PHP 7.4 package and other required PHP extensions.

ADVERTISEMENT
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update

Once you have added the PPA you can install PHP 7.4.

Install PHP 7.4 for Apache

Execute the following command to install PHP 7.4

ADVERTISEMENT
sudo apt install php7.4

After the installation has completed, you can confirm the installation using the following command

php -v

Install PHP 7.4 FPM for Nginx

For Nginx you need to install FPM, execute the following command to install PHP 7.4 FPM

ADVERTISEMENT
sudo apt install php7.4-fpm

After the installation has completed, confirm that PHP 7.4 FPM has installed correctly with this command

php-fpm7.4 -v

Install PHP 7.4 Extensions

Installing PHP extensions are simple with the following syntax.

sudo apt install php7.4-extension_name

Now, install some commonly used php-extensions with the following command.

sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y

Configure PHP 7.4

Now we configure PHP for Web Applications by changing some values in php.ini file.

For PHP 7.4 with Apache the php.ini location will be in following directory.

sudo nano /etc/php/7.4/apache2/php.ini

For PHP 7.4 FPM with Nginx the php.ini location will be in following directory.

sudo nano /etc/php/7.4/fpm/php.ini

Hit F6 for search inside the editor and update the following values for better performance.

upload_max_filesize = 32M 
post_max_size = 48M
memory_limit = 256M
max_execution_time = 600
max_input_vars = 3000
max_input_time = 1000

Once you have modified your PHP settings you need to restart your Apache for the changes to take effect.

Configure PHP 7.4 FPM Pools

PHP 7.4 FPM allows you to configure the user and group that the service will run under. You can modify these with these commands

sudo nano /etc/php/7.4/fpm/pool.d/www.conf

Change the following lines by replacing the www-data with your username.

user = username 
group = username 
listen.owner = username
listen.group = username

Hit CTRL+X and Y to save the configuration and check if the configuration is correct and restart PHP.

Restart PHP 7.4 FPM

Once you have updated your PHP FPM settings you need to restart it to apply the changes.

sudo php-fpm7.4 -t 
sudo service php7.4-fpm restart

Now you are having PHP 7.4 Installed and configured.

Prepare yourself for a role working as an Information Technology Professional with Linux operating system

Upgrade to PHP 7.4

Once you have installed PHP 7.4 you need to upgrade to the latest installed version of PHP.

Follow these steps to upgrade to PHP 7.4 with Apache or Nginx.

Conclusion

Now you have learned how to install PHP 7.4 on your Ubuntu server.

Thanks for your time. If you face any problem or any feedback, please leave a comment below.

Tags: NginxPHPUbuntu 18.04
Share13Tweet8SendShare
Cloudbooklet

Cloudbooklet

Comments 3

  1. Avatar Of Alex Alex says:
    3 years ago

    Thx for this info man. It was what i need

    Reply
  2. Avatar Of Tom tom says:
    4 years ago

    hi there, i guess you need to disable the old php version and enable the new one. then restart apache.

    sudo a2dismod php7.0
    sudo a2enmod php7.4
    systemctl restart apache2

    br, tom

    Reply
    • Avatar Of Cloudbooklet Cloudbooklet says:
      4 years ago

      Hi, thanks for using this guide. You can check this details post for upgrading.

      https://www.cloudbooklet.com/upgrade-php-version-to-php-7-4-on-ubuntu/

      Reply

Leave a Reply Cancel reply

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

Related Posts

How To Setup Ssh Keys On Ubuntu

How to Setup SSH Keys on Ubuntu 20.04

4 months ago
Draggan Ai Editing Tool Install And Use Draggan Photo Editor

DragGAN AI Editing Tool Install and Use DragGAN Photo Editor

4 months ago
Set Up Deep Learning With Nvidia, Cuda, Cudnn On Ubuntu

How to Set Up Deep Learning with Nvidia, CUDA, cuDNN on Ubuntu 22.04

7 months ago
How To Install Or Upgrade Php 8.2 On Ubuntu 22.04

How to Install or Upgrade PHP 8.2 on Ubuntu 22.04

9 months ago

Follow Us

Trending Articles

Ai And Smart Home

AI and Smart Home Technology: How They Work Together

September 27, 2023

How to Fix Windows 10 Sleep Mode Issues in 5 Easy Steps

Types of AI: Interactive, Generative What They Are and How They Work

Top 7 Ways to Download Udemy Videos for Free

5 Steps to Find if Free VPN is Safe or Not

7 Best AI Product Photography Tools and Services in 2023

Popular Articles

Joyland Ai

What is Joyland AI Chatbot and How Does It Work?

September 25, 2023

Top 5 AI Jewellery Generators to Create Jewellery Designs

How to Easily Remove Background in Microsoft Paint and Paint 3D

10 Best Gay Dating Apps to Use in 2023

7 Best AI Finance Tools That Will Transform Your Business in 2023

Top 7 AI Dream Interpreter to Understand Your Dreams

Subscribe Now

loader

Subscribe to our mailing list to receives daily updates!

Email Address*

Name

Cloudbooklet Logo

Welcome to our technology blog, where we explore the latest advancements in the field of artificial intelligence (AI) and how they are revolutionizing cloud computing. In this blog, we dive into the powerful capabilities of cloud platforms like Google Cloud Platform (GCP), Amazon Web Services (AWS), and Microsoft Azure, and how they are accelerating the adoption and deployment of AI solutions across various industries. Join us on this exciting journey as we explore the endless possibilities of AI and cloud computing.

  • About
  • Contact
  • Disclaimer
  • Privacy Policy

Cloudbooklet © 2023 All rights reserved.

No Result
View All Result
  • News
  • Artificial Intelligence
  • Applications
  • Linux

Cloudbooklet © 2023 All rights reserved.