PHP 5.6 on Mint

#!/bin/bash
# init
function pause()
{
read -p “$*”
}

echo “”
echo “——————————————————-”
echo ” This script will INSTALL PHP 5.5.8 – ON MINT 18 ”
echo ” YOU WILL SEE MANY WARNINGS – BUT IT BUILDS & WORKS. ”
echo ” WITHOUT EDITS THIS WILL REMOVE HTDOCS AND CONF ”
echo ” DIRECTORIES – EDIT AS DESIRED. ”
echo “——————————————————-”
echo “”
read -p “Press ANY KEY TO CONTINUE……………..”
echo “”
#cp -R php.ini /usr/local/src
cp LINK* /usr/local/src
cp phpmyadmin.tar /usr/local/src

cp memcached.conf /usr/local/src
cp php.ini.5.6 /usr/local/src
cp htdocs.tar /usr/local/src
cp httpd.conf /usr/local/src
cp php-5.6.25.tar.gz /usr/local/src
cp launch_2018.tar /usr/local/src
cp conf_for_eware_needs_cert.tar /usr/local/src

cd /usr/local/src/
tar zxvf php-5.6.25.tar.gz
echo “”
echo “—————————————————–”
echo ” For some reason, at this point, I had to reinstall ”
echo ” libmcrypt-dev…..so we’ll do that first, then ”
echo ” continue with the PHP build. ”
echo “—————————————————–”
echo “”
read -p “Continue…………”
echo “”
apt-get install –reinstall libmcrypt-dev

apt-get install libmariadbd-dev

cd php-5.6.25

make clean

./buildconf –force

./configure \
–with-apxs2=/usr/local/apache2/bin/apxs \
–with-config-file-scan-dir=/etc/php5 \
–with-config-file-path=/usr/local/lib \
–disable-debug \
–enable-ftp \
–enable-inline-optimization \
–enable-mbstring \
–enable-sockets \
–enable-wddx=shared \
–enable-ftp \
–enable-exif \
–enable-calendar \
–enable-sysvsem \
–enable-sysvshm \
–enable-sysvmsg \
–enable-bcmath \
–enable-tokenizer \
–with-bz2 \
–enable-ctype \
–with-iconv \
–with-gettext \
–enable-shmop \
–enable-wddx \
–enable-intl \
–with-imap-ssl \
–enable-soap \
–with-gettext \
–with-libxml-dir=/opt \
–with-mysql \
–with-pdo-mysql \
–with-pdo-sqlite \
–with-mysqli=mysqlnd \
–with-regex=system \
–with-openssl \
–with-freetype-dir=/usr \
–with-jpeg-dir=/usr/include/jpeg \
–with-gd \
–with-zlib-dir=/usr \
–with-mcrypt=/usr/local/bin \
–enable-opcache \
–enable-embedded-mysqli \
–with-curl \
–with-recode=/usr/include \
–with-pear=/usr/local/php5/lib

echo “”
echo “——————————————————-”
echo ” Add the following to Makefile EXTRA_LIBS: ”
echo ” -llber (BEFORE THE LAST ENTRY!) ”
echo ” In other words, the end of the line should be this: ”
echo ” -llber -lcrypt ”
echo “——————————————————-”
echo “”
read -p “Open Makefile and edit – PRESS ENTER…”
echo “”
nano /usr/local/src/php-5.6.25/Makefile

make

make install

echo “”
echo “—————————————”
echo ” Install PHP libs… ”
echo “—————————————”
echo “”
read -p “Continue…………….”
echo “”

sudo libtool –finish /usr/local/src/php-5.6.25/libs

echo “”
echo “”
cp /usr/local/src/php.ini.5.6 /usr/local/lib/
cp /usr/local/src/memcached.conf /etc/memcached.conf

service memcached restart

cp /usr/local/src/htdocs.tar /usr/local/apache2
cp /usr/local/src/conf_for_eware_needs_cert.tar /usr/local/apache2
cp /usr/local/src/launch_2018.tar /usr/local/apache2

cd /usr/local/apache2

rm -rf conf
tar xvf conf_for_eware_needs_cert.tar > /dev/null
rm -rf htdocs
tar xvf htdocs.tar
tar xvf launch_2018.tar

chmod -R 777 launch
chmod -R 777 conf

cd htdocs

mkdir secure
chmod -R 777 secure

Leave a Reply

Your email address will not be published. Required fields are marked *