[root@200976 ~]# php -v
PHP 7.4.19 (cli) (built: May 20 2021 05:25:29) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with the ionCube PHP Loader + ionCube24 v10.4.3, Copyright (c) 2002-2020, by ionCube Ltd.
with Zend OPcache v7.4.19, Copyright (c), by Zend Technologies
apt-get install -y libxslt-dev libcurl4-gnutls-dev libfcgi-dev libfcgi0ldbl libmcrypt-dev libssl-dev libxml2-dev zlib1g-dev libcurl4-gnutls-dev libjpeg-turbo8-dev libbz2-dev libjpeg-dev libfreetype6-dev libmcrypt-dev libcurl4-gnutls-dev
apt-get install -y libpq-dev
cd /usr/include
cd /usr/local/include
sudo ln -s /usr/include/x86_64-linux-gnu/curl curl
mkdir /opt/php5.4.45
mkdir /usr/local/src/php5
cd /usr/local/src/php5
wget http://de2.php.net/get/php-5.4.45.tar.gz/from/this/mirror
mv mirror php-5.4.45.tar.gz
tar -xzvf php-5.4.45.tar.gz
cd php-5.4.45
./configure \
--prefix=/opt/php5.4.45 \
--with-pdo-pgsql \
--with-zlib-dir \
-with-freetype \
--enable-mbstring \
--with-libxml-dir=/usr \
--enable-soap \
--enable-calendar \
--with-curl \
--with-mcrypt \
--with-zlib \
--with-gd \
--with-pgsql \
--disable-rpath \
--enable-inline-optimization \
--with-bz2 \
--with-zlib \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-pcntl \
--enable-mbregex \
--with-mhash \
--enable-zip \
--with-pcre-regex \
--with-mysql \
--with-pdo-mysql \
--with-mysqli \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--enable-gd-native-ttf \
--with-fpm-user=www-data \
--with-fpm-group=www-data \
--with-libdir=/lib/x86_64-linux-gnu \
--enable-ftp \
--with-kerberos \
--with-gettext \
--enable-fpm
make
make install
cp /usr/local/src/php5/php-5.4.45/php.ini-production /opt/php5.4.45/lib/php.ini
cp /opt/php5.4.45/etc/php-fpm.conf.default /opt/php5.4.45/etc/php-fpm.conf
sed -i 's/listen = 127.0.0.1:9000/listen = 127.0.0.1:8998/g' /opt/php5.4.45/etc/php-fpm.conf
sed -i 's/\x3Bpid = run\/php-fpm.pid/pid = run\/php-fpm.pid/g' /opt/php5.4.45/etc/php-fpm.conf
echo "include=/opt/php5.4.45/etc/pool.d/*.conf" >> /opt/php5.4.45/etc/php-fpm.conf
mkdir /opt/php5.4.45/etc/pool.d
vim /etc/init.d/php5.4.45-fpm # вставляем конфиг, и правим версию пхп https://www.howtoforge.com/how-to-use-multiple-php-versions-php-fpm-and-fastcgi-with-ispconfig-3-ubuntu-12.10-p3
chmod 755 /etc/init.d/php5.4.45-fpm
#заменяем актуальной версией php, плс название в общем стиле а не как по ману
sed -i 's/php\-5\.4\.12/php5.4.45/g' /etc/init.d/php5.4.45-fpm
update-rc.d php5.4.45-fpm defaults
/etc/init.d/php5.4.45-fpm start
update-rc.d php7.3-fpm defaults
apt-get install libmemcached-dev
# исправит проблему подключения по loalhost поскольку в стандартных php.ini она вообще не обьявлена
echo "mysqli.default_socket = /var/run/mysqld/mysqld.sock" >> /opt/php5.4.45/lib/php.ini
echo "mysqli.default_socket = /var/run/mysqld/mysqld.sock" >> /opt/php5.4.45/lib/php.ini
/etc/init.d/php5.4.45-fpm restart
/etc/init.d/apache2 restart