Skip to content

Instantly share code, notes, and snippets.

@mort3za
Last active February 15, 2024 14:16
Show Gist options
  • Save mort3za/a27376bbaeea03b41712f44a2030ede8 to your computer and use it in GitHub Desktop.
Save mort3za/a27376bbaeea03b41712f44a2030ede8 to your computer and use it in GitHub Desktop.
Install php 5.6 and composer in ubuntu 18.04
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6
php --version
sudo apt-get install php5.6-curl php5.6-xml
sudo apt-get install composer
@Ganesh-DevOps-Eng
Copy link

this solution is working for please few more commands ,,, let me add in this

#!/bin/bash
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6
php --v
sudo apt-get install php5.6-curl php5.6-xml
sudo apt-get install composer
sudo apt-get install php5.6-pgsql
sudo systemctl restart apache2

@foxeslover
Copy link

Not working:
Note, selecting 'php5.6-json' for regex 'php5.6'
Note, selecting 'php5.6-common' for regex 'php5.6'
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.

E: Unable to locate package php5.6-curl
E: Couldn't find any package by glob 'php5.6-curl'
E: Couldn't find any package by regex 'php5.6-curl'
E: Unable to locate package php5.6-xml
E: Couldn't find any package by glob 'php5.6-xml'
E: Couldn't find any package by regex 'php5.6-xml'

@selfieebritto
Copy link

ppa:ondrej/php not support ubuntu 18.04

@hardlevel
Copy link

Not working: Note, selecting 'php5.6-json' for regex 'php5.6' Note, selecting 'php5.6-common' for regex 'php5.6' 0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.

E: Unable to locate package php5.6-curl E: Couldn't find any package by glob 'php5.6-curl' E: Couldn't find any package by regex 'php5.6-curl' E: Unable to locate package php5.6-xml E: Couldn't find any package by glob 'php5.6-xml' E: Couldn't find any package by regex 'php5.6-xml'

if you are using docker, you can´t install the extensions like php5.6-{xml,bz2, etc...}, you need to write the full name of each extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment