Answer the question
In order to leave comments, you need to log in
Installing old version of PHP (5.4) on Debian 9?
How to install php5.4 on Debian 9? There is already php7 next to it, but one old project refuses to work in it.
I want to compile php5.4 specifically for this old project (I would even say ancient). You need fpm version, because. web server - nginx.
There was a command in one instruction, apt-get build-dep php5
but I have an error with it:E: Unable to find a source package for php5
Answer the question
In order to leave comments, you need to log in
In general, I managed to compile ... it turned out to be easier than I thought)
There is no need to do any "apt-get build-dep php5". Compiled php 5.4.45 on Debian 9. Works fine.
Just checked
apt-get update
apt-get install -y libfcgi-dev libfcgi0ldbl libjpeg62-dbg 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
ln -s /usr/include/x86_64-linux-gnu/curl curl
cd /usr/local/include
mkdir /opt/php-5.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/php-5.4.45 --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --enable-mbstring --enable-sockets --enable-exif --enable-bcmath --enable-calendar --enable-zip --enable-ftp --enable-gd-native-ttf --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-freetype-dir --with-zlib --with-zlib-dir --with-bz2 --with-mcrypt --with-mhash --with-pcre-regex --with-libxml-dir=/usr --with-xmlrpc --with-xsl --with-mysql --with-libdir=/lib/x86_64-linux-gnu --with-curl
make
make install
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question