Skip to content

Instantly share code, notes, and snippets.

@phpfour
Last active July 5, 2016 17:46
Show Gist options
  • Save phpfour/b76a8c95a9da4ca30096a075699cf8e3 to your computer and use it in GitHub Desktop.
Save phpfour/b76a8c95a9da4ca30096a075699cf8e3 to your computer and use it in GitHub Desktop.
CentOS 7.x Preparation for PHP Application
# Add the EPEL repositories:
sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm
# Add the Remi Repositories:
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
# Install Apache:
sudo yum --enablerepo=remi,remi-php56 install httpd
# Install PHP with packages:
sudo yum --enablerepo=remi,remi-php56 install php php-common php-devel php-intl php-pear php-pdo php-curl
sudo yum --enablerepo=remi,remi-php56 install php-pecl-apcu php-cli php-mysqlnd php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml
# Install ImageMagick
sudo yum --enablerepo=remi,remi-php56 install ImageMagick php-imagick
# Install MariaDB:
cat > /etc/yum.repos.d/MariaDB.repo <<EOL
# MariaDB 10.1 CentOS repository list - created 2016-05-02 06:24 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOL
sudo yum install MariaDB-server MariaDB-client
# Enable Apache to load on startup and start it:
sudo systemctl start httpd.service
sudo systemctl enable httpd.service
# Enable MariaDB to load on startup and start it:
sudo systemctl enable mariadb
sudo systemctl start mariadb
# Allow Apache to connect to DB:
sudo setsebool -P httpd_can_network_connect=1
sudo setsebool -P httpd_can_network_connect_db=1
# Allow Apache to write to directory:
chcon -R -t httpd_sys_content_t /var/www
chcon -R -t httpd_sys_content_t /var/www/docudex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment