Nvidia Unveils Futuristic Gaming Experience at Computex 2023
News

Nvidia Unveils Futuristic Gaming Experience at Computex 2023, Blending Gaming and AI

by Isabel
May 29, 2023
0

At Computex 2023, Nvidia displays a futuristic gaming experience that...

Read more
Adobe Introduces Powerful Generative AI Tools in Photoshop

Adobe Introduces Powerful Generative AI Tools in Photoshop Beta

May 29, 2023
Adobe Photoshop's Generative Fill Feature

Exploring the Power of Adobe Photoshop’s Generative Fill Feature

May 27, 2023
NVIDIA and Microsoft Partner to Accelerate AI

NVIDIA and Microsoft Partner to Accelerate AI

May 25, 2023
google photos security and privacy

Exploring the Top 5 Privacy and Security Risks of using Google Photos

May 24, 2023
Is ChatGPT down

Is ChatGPT Down? Here’s What You Need to Know

May 5, 2023
Cerebras-GPT

How Cerebras-GPT is Revolutionizing Natural Language Processing

May 12, 2023
Open AI ChatGPT Plugins

ChatGPT Plugins: Complete Guide

April 27, 2023
DragGAN AI editing Tool Install and Use DragGAN Photo Editor

DragGAN AI editing Tool Install and Use DragGAN Photo Editor

May 27, 2023
What is ChoasGPT

What is chaosGPT?

April 20, 2023
God Mode GPT

God Mode GPT: The Revolutionary AI

May 15, 2023
Cloudbooklet
  • News
  • Artificial Intelligence
  • Linux
  • Google Cloud
  • AWS
No Result
View All Result
Cloudbooklet
  • News
  • Artificial Intelligence
  • Linux
  • Google Cloud
  • AWS
No Result
View All Result
Cloudbooklet
No Result
View All Result
Home Google Cloud

Upgrade PHP version to PHP 7.4 on Ubuntu

by Cloudbooklet
July 23, 2021
in Google Cloud
Reading Time: 5 mins read
Upgrade PHP version to PHP 7.4 on Ubuntu
Share on FacebookShare on TwitterShare on WhatsAppShare on Telegram

Upgrade PHP version to PHP 7.4 on Ubuntu. You can upgrade your current PHP version to the latest release PHP 7.4 on your Ubuntu 18.04.

This upgrade is tested on virtual machine instance running Ubuntu 18.04 OS on Google Cloud Compute Engine. So the steps mentioned in this guide works on any cloud servers like AWS, DigitalOcean, Linode, Vultr or any VPS or Dedicated servers running Ubuntu 18.04.

You might also like

How to Setup SSH Keys on Ubuntu

How to Setup SSH Keys on Ubuntu 20.04

May 31, 2023
Set Up Deep Learning with Nvidia, Cuda, cuDNN on Ubuntu

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

May 27, 2023

Here is a brief guide to show you how to install and upgrade to PHP 7.4 on Ubuntu 18.04 LTS with Apache and PHP7.4-fpm with Nginx.

You can follow this guide to Upgrade to PHP 8

Add PPA for PHP 7.4

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

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

sudo apt install php7.4

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

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

php -v

Enable PHP 7.4 for Apache

Now you need to tell Apache to use the installed version of PHP 7.4 by disabling the old PHP module (below I have mentioned php7.0, you need to use your current php version used by Apache) and enabling the new PHP module using the following command.

sudo a2dismod php7.0
sudo a2enmod php7.4

Restart Apache for the changes to take effect.

sudo service apache2 restart

Install PHP 7.4 FPM for Nginx

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

sudo apt install php7.4-fpm

Follow the same method above mentioned to install the extensions

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

php-fpm7.4 -v

Modify Nginx configuration to use PHP 7.4

For Nginx you need to update the PHP-FPM socket in your Nginx configration located inside the sites-available directory. This will be located inside the location block location ~ \.php$

Edit your configuration…

sudo nano /etc/nginx/sites-available/your.conf

The line you need to modify will look like this…

fastcgi_pass unix:/run/php/php7.0-fpm.sock; 

You need to replace the old PHP version with the new version.

fastcgi_pass unix:/run/php/php7.4-fpm.sock; 

Test your configration.

sudo nginx -t

Save the file and exit the editor and restart Nginx for the changes to take effect.

sudo service nginx restart

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

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

Conclusion

Now you have learned how to upgrade PHP to PHP 7.4 on Ubuntu 18.04.

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

Tags: Compute EngineGoogle Cloud PlatformUbuntu 18.04
Share9Tweet6SendShare
Cloudbooklet

Cloudbooklet

Help us grow and support our blog! Your contribution can make a real difference in providing valuable content to our readers. Join us in our journey by supporting our blog today!
Buy me a Coffee

Related Posts

How to Install or Upgrade PHP 8.2 on Ubuntu 22.04

How to Install or Upgrade PHP 8.2 on Ubuntu 22.04

April 13, 2023
How to Change Timezone on Ubuntu 22.04

How to Change Timezone on Ubuntu 22.04

May 16, 2023
How to Install Ansible on Ubuntu 22.04

How to Install Ansible on Ubuntu 22.04

May 19, 2023
How to Install PHP-FPM with Apache on Ubuntu 22.04

How to Install PHP-FPM with Apache on Ubuntu 22.04

May 19, 2023

Comments 28

  1. Jerry T says:
    9 months ago

    Thanks very much, worked great!

    Reply
  2. Pervobil says:
    2 years ago

    When I enter the command “sudo nano /etc/nginx/sites-available/your.conf”, he answers me:
    “Directory ‘/etc/nginx/sites-available’ does not exist”

    Help solve the problem please!

    Reply
Next

Leave a Reply Cancel reply

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

I agree to the Terms & Conditions and Privacy Policy.

  • Trending
  • Comments
  • Latest
DragGAN The AI-Powered Image Editing Tool

DragGAN: The AI-Powered Image Editing Tool That Makes Editing Images Easy

May 30, 2023
DragGAN AI editing Tool Install and Use DragGAN Photo Editor

DragGAN AI editing Tool Install and Use DragGAN Photo Editor

May 27, 2023
Bard API key

Everything You Need to Know About Google’s Bard API Key

May 20, 2023
Install PHP 8.1 on Ubuntu

How to Install or Upgrade PHP 8.1 on Ubuntu 20.04

May 17, 2023
DragGAN The AI-Powered Image Editing Tool

DragGAN: The AI-Powered Image Editing Tool That Makes Editing Images Easy

75
Upgrade PHP version to PHP 7.4 on Ubuntu

Upgrade PHP version to PHP 7.4 on Ubuntu

28
Install Odoo 13 on Ubuntu 18.04 with Nginx - Google Cloud

Install Odoo 13 on Ubuntu 18.04 with Nginx – Google Cloud

25
Best Performance WordPress with Google Cloud CDN and Load Balancing

Best Performance WordPress with Google Cloud CDN and Load Balancing

23
How to Setup SSH Keys on Ubuntu

How to Setup SSH Keys on Ubuntu 20.04

May 31, 2023
ChatGPT app

The Easiest Way to Download ChatGPT App Free

May 31, 2023
LLM Connected with APIs

Gorilla: LLM Connected with APIs

May 31, 2023
Soundstorm-Pytorch

Soundstorm-Pytorch: A Powerful Tool for Audio Generation

May 30, 2023

Popular Articles

  • DragGAN The AI-Powered Image Editing Tool

    DragGAN: The AI-Powered Image Editing Tool That Makes Editing Images Easy

    1436 shares
    Share 574 Tweet 359
  • DragGAN AI editing Tool Install and Use DragGAN Photo Editor

    332 shares
    Share 133 Tweet 83
  • Auto-Photoshop-Stable Diffusion-Plugin: A New Way to Create AI-Generated Images in Photoshop

    70 shares
    Share 28 Tweet 18
  • InternGPT: A New Way to Interact with ChatGPT

    53 shares
    Share 21 Tweet 13
  • Midjourney vs Adobe Firefly: A Comparison of Two AI Image Generation Tools

    10 shares
    Share 4 Tweet 3
Cloudbooklet

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
  • Linux
  • Google Cloud
  • AWS

Cloudbooklet © 2023 All rights reserved.

This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.