87

I need to make my Ubuntu 16.04. Is there a way using the GUI or is the simplest way to do this by using terminal?

I have already installed PHP 7.1, MariaDB.

I need to enable:

  1. OpenSSL PHP Extension
  2. PDO PHP Extension
  3. Mbstring PHP Extension
  4. Tokenizer PHP Extension
  5. XML PHP Extension
Madan Sapkota
  • 25,047
  • 11
  • 113
  • 117
Aipo
  • 1,805
  • 3
  • 23
  • 48
  • 2
    What's the exact question here? What keeps you from installing the list of extensions as you usually do it, and as it is documented on many tutorials? – Nico Haase Jan 24 '20 at 10:23

6 Answers6

222

The Laravel server requirements specify the PHP extensions, including BCMath, Ctype, cURL, DOM, Fileinfo, JSON, Mbstring, OpenSSL, PCRE, PDO, Tokenizer, and XML, are required. These extensions are usually included and enabled during a PHP installation.

You can use the following command in Ubuntu to check the necessary extensions.

sudo apt install openssl php-bcmath php-curl php-json php-mbstring php-mysql php-tokenizer php-xml php-zip

Installation specific to a particular version of PHP (such as PHP 8.2)

sudo apt install openssl php8.2-bcmath php8.2-curl php8.2-json php8.2-mbstring php8.2-mysql php8.2-tokenizer php8.2-xml php8.2-zip

Additional PHP extensions may require for your composer packages. Refer to the links below for more information.

PHP extensions for Ubuntu 22.04 LTS (Jammy Jellyfish)

PHP extensions for Ubuntu 20.04 LTS (Focal Fossa)

PHP extensions for Ubuntu 18.04 LTS (Bionic)

PHP extensions for Ubuntu 16.04 LTS (Xenial)

Madan Sapkota
  • 25,047
  • 11
  • 113
  • 117
  • 1
    Does it uncomment ";" in my php.ini? – Aipo Nov 26 '16 at 07:28
  • 1
    If not you can find the ini file here ```/etc/php/7.x/apache2/php.ini```. Edit and restart Apache. – Madan Sapkota Nov 26 '16 at 07:38
  • 1
    Are you sure that php-common and php-zip are needed? I found that `sudo apt-get install php-mbstring php-xml unzip` was enough. I could be wrong though – Chris Dec 29 '18 at 11:23
  • @Chris at least mbstring depends on common. It will be installed by apt when you confirm to do so. Laravel does not need zip AFAIK, but composer is happy about it. – RiWe Jan 24 '20 at 10:51
  • 1
    This one worked for Laravel 9 with PHP 8.2 – Disapamok Feb 02 '23 at 07:49
6

**

New requirements for installing Laravel 8 and PHP 8:

**

sudo apt install php8.0-common php8.0-dom php8.0-bcmath openssl php8.0-mbstring
Paul
  • 77
  • 1
  • 2
4

Run the below command. It will install all required php8.1 extensions in Ubuntu

sudo apt install php8.1 php8.1-cli php8.1-common php8.1-mysql php8.1-zip php8.1-curl php8.1-gd php8.1-mbstring php8.1-xml php8.1-bcmath php8.1-fpm php8.1-phpdbg php8.1-cgi libphp8.1-embed libapache2-mod-php8.1
2

All the steps to install php8.2 for laravel 10:

update and upgrade:

sudo apt update && sudo apt upgrade -y

add repository:

sudo add-apt-repository ppa:ondrej/php

update repository:

sudo apt update

The complete list of all the needed PHP extension:

sudo apt-get install -y php php-cli php-common php-fpm php-mysql php-zip php-gd php-mbstring php-curl php-xml php-bcmath openssl php-json php-tokenizer

The complete list of all the needed PHP extension with version 8.2:

sudo apt-get install -y php8.2 php8.2-cli php8.2-common php8.2-fpm php8.2-mysql php8.2-zip php8.2-gd php8.2-mbstring php8.2-curl php8.2-xml php8.2-bcmath openssl php8.2-json php8.2-tokenizer
ba0708
  • 10,180
  • 13
  • 67
  • 99
Raskul
  • 1,674
  • 10
  • 26
-1

You can install PHP extensions like this:

sudo apt-get install php-xsl php-pgsql
ahmnouira
  • 1,607
  • 13
  • 8
-1

Here is Extension with Name and Commands for UBUNTU

  1. Install or enable PHP's curl extension

    sudo apt install phpy-curl

  2. Install or enable PHP's simplexml extension.

    sudo apt install php-xml

  3. Install or enable PHP's gd extension

    sudo apt-get install php-gd

  4. Install or enable PHP's zip extension

    sudo apt install php-zip