installphp.info


← Back to home page

Install PHP 7.1 on Ubuntu 23.10

This version of PHP is actively supported.

Good news! PHP 7.1 is being actively supported through 20 Sep 2024. After that point, it's advisable to upgrade to the latest version, since the PHP team will only offer security-related support until 20 Sep 2024, at which point PHP 7.1 will be considered "end-of-life".

Installing PHP 7.1 on Ubuntu 23.10

Prerequisites

  • Ubuntu 23.10 installed and updated
  • Sudo or root access to the system
  • Terminal access
  • Internet connection

Installation

  1. Open a terminal window
  2. Update the package list:
    sudo apt update
  3. Add the PHP repository:
    sudo add-apt-repository ppa:ondrej/php
  4. Update the package list again:
    sudo apt update
  5. Install PHP 7.1:
    sudo apt install php7.1
  6. Install common PHP extensions:
    sudo apt install php7.1-common php7.1-mysql php7.1-xml php7.1-xmlrpc php7.1-curl php7.1-gd php7.1-imagick php7.1-cli php7.1-dev php7.1-imap php7.1-mbstring php7.1-opcache php7.1-soap php7.1-zip php7.1-intl -y

Verification

  1. Check the PHP version:
    php -v
  2. The output should show PHP 7.1.x
  3. Verify PHP configuration:
    php -i
  4. Check installed PHP modules:
    php -m