Skip to content

Instantly share code, notes, and snippets.

@slapo
Last active December 20, 2017 15:04
Show Gist options
  • Save slapo/5091eeb833098fd2c763cfafbfa37c0b to your computer and use it in GitHub Desktop.
Save slapo/5091eeb833098fd2c763cfafbfa37c0b to your computer and use it in GitHub Desktop.
Yum command to install PHP and extensions required for Symfony/Symfony Demo app and useful for further development.
#!/bin/bash
## Install yum-utils to get yum-config-manager and epel to be able to install Remi's repository later on.
yum -y install yum-utils epel-release
## Retrieve GPG keys
wget https://rpms.remirepo.net/RPM-GPG-KEY-remi
wget https://rpms.remirepo.net/RPM-GPG-KEY-remi2017
wget https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-10
## Retrieve Remi, PostgreSQL 10 repository and Anku () RPMs
wget https://rpms.remirepo.net/enterprise/remi-release-7.rpm
wget https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm
## Have RPM import repository keys
rpm --import RPM-GPG-KEY-remi
rpm --import RPM-GPG-KEY-remi2017
rpm --import RPM-GPG-KEY-PGDG-10
## Grab and install Wandisco Git
wget https://gist.githubusercontent.com/slapo/625213dbdca5a1e564e7f57395a5e405/raw/fbd391d7073e412af4af5ae05887782a21ca6bb7/wandisco-git.repo
mv wandisco-git.repo /etc/yum.repos.d/wandisco-git.repo
## Install repository packages
yum -y install remi-release-7.rpm pgdg-centos10-10-2.noarch.rpm
yum -y install https://downloads.ulyaoth.net/rpm/ulyaoth-latest.centos.x86_64.rpm
## Enable new repositories
yum-config-manager --enable "remi"
yum-config-manager --enable "remi-php72"
yum-config-manager --enable "pgdg10"
yum-config-manager --enable "wandisco-git"
yum-config-manager --enable "ulyaoth"
## Install latest packages
yum -y install git php-fpm php-cli php-gd php-igbinary php-pdo php-xml php-mbstring php-process php-intl postgresql10 postgresql10-server ulyaoth-hiawatha php-pgsql php-pq
## Initialise PostgreSQL
/usr/pgsql-10/bin/initdb -D /var/lib/pgsql/10/data/
## Enable daemons to start automatically
systemctl enable postgresql-10
systemctl enable php-fpm
systemctl enable hiawatha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment