Skip to content

Instantly share code, notes, and snippets.

@mylxsw

mylxsw/install_php72.sh

Last active Jul 16, 2020
Embed
What would you like to do?
install_php72.sh
#!/usr/bin/env bash
mkdir /data/software
cd /data/software
yum install -y libxslt-devel libcurl-devel openssl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel
wget http://hk1.php.net/distributions/php-7.2.3.tar.gz
tar -zxvf php-7.2.3.tar.gz
cd php-7.2.3
./configure --prefix=/usr/local/php72 --with-curl --with-freetype-dir --with-jpeg-dir --with-png-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip --enable-ftp --with-config-file-path=/usr/local/php72/etc
make && make install
cp php.ini-production /usr/local/php72/bin/php.ini
ln -s /usr/local/php72/bin/php.ini /usr/local/php72/etc/php.ini
ln -s /usr/local/php72/bin/php.ini /usr/local/php72/lib/php.ini
ln -s /usr/local/php72/bin/php.ini /etc/php.ini
ln -s /usr/local/php72/bin/php /usr/local/bin/php
ln -s /usr/local/php72/bin/pecl /usr/local/bin/pecl
ln -s /usr/local/php72/bin/php-config /usr/local/bin/php-config
ln -s /usr/local/php72/bin/phpize /usr/local/bin/phpize
ln -s /usr/local/php72/sbin/php-fpm /usr/local/sbin/php-fpm
ln -s /usr/local/php72 /usr/local/php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.