Last active
November 14, 2019 17:43
-
-
Save nunorbatista/919d8e888115930cebe2 to your computer and use it in GitHub Desktop.
PHP7 Centos 7 fresh install script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/!/bin/bash | |
# update system | |
yum update -y | |
# install bind-utils | |
sudo yum install bind-utils | |
# Apache | |
yum install nano wget curl vim git httpd -y | |
# Bring repos in | |
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm | |
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm | |
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm | |
# get latest mysql | |
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm | |
yum localinstall mysql-community-release-el7-5.noarch.rpm -y | |
yum install mysql-community-server -y | |
systemctl enable mysqld.service | |
/bin/systemctl start mysqld.service | |
# DEV Tools | |
yum groupinstall 'Development tools' -y | |
# Install PHP7 | |
yum install -y php70w php70w-opcache php70w-cli php70w-common php70w-gd php70w-mbstring php70w-mcrypt php70w-pdo php70w-xml php70w-mysqlnd | |
# Configure it | |
rm /etc/httpd/conf.d/php.conf -rf | |
rm /etc/httpd/conf.modules.d/10-php.conf -rf | |
# Load PHP7 into apache | |
touch /etc/httpd/conf.d/php7.conf | |
cat << EOF > /etc/httpd/conf.d/php7.conf | |
LoadModule php7_module /usr/lib64/httpd/modules/libphp7.so | |
<FilesMatch \.php$> | |
SetHandler application/x-httpd-php | |
</FilesMatch> | |
EOF | |
# Install NodeJS | |
sudo yum install nodejs -y | |
sudo yum install npm -y | |
# Start Apache | |
systemctl enable httpd | |
systemctl start httpd | |
# Install Composer | |
curl -sS https://getcomposer.org/installer | php | |
sudo mv composer.phar /usr/local/bin/composer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment