PHP 5.6 additional version on Debian 9

Discussion in 'Installation/Configuration' started by ChuckSC, Oct 1, 2017.

  1. ChuckSC

    ChuckSC New Member

    Hello everyone,

    I'm looking at running PHP 5.6 for legacy reasons in addition to version 7.0 currently as default. My server is running on Debian 9 (Stretch) with ISPConfig 3.1.7.

    At this point if I understand well, this is still somewhat tricky due to compatibility issues so I could use your guidance. Here's where I'm at:
    1. mkdir /opt/php-5.6.31
    2. mkdir /usr/local/src/php5-build
    3. cd /usr/local/src/php5-build
    4. wget http://fr2.php.net/get/php-5.6.31.tar.bz2/from/this/mirror -O php-5.6.31.tar.bz2
    5. tar jxf php-5.6.31.tar.bz2
    6. cd php-5.6.31/
    7. apt-get install build-essential
    8. apt-get build-dep php7.0 (build-dep php5 does not work)
    9. apt-get install libfcgi-dev libfcgi0ldbl libjpeg-dev libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev libxml2-dev libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libfreetype6-dev libkrb5-dev libpq-dev libxml2-dev libxslt1-dev
    10. cd /usr/include
    11. ln -s x86_64-linux-gnu/curl (needed to avoid curl not being found later)
    12. ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu/libc-client.agit
    13. cd /usr/local/src/php5-build/php-5.6.31
    14. ./configure --prefix=/opt/php-5.6.31 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --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 --enable-exif --enable-bcmath --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-openssl --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm.
    15. make
    And that's where the process stops by spewing a long list of errors with Openssl, such as:
    Code:
    Makefile:635: recipe for target 'ext/openssl/openssl.lo' failed
    make: *** [ext/openssl/openssl.lo] Error 1
    ... with many other errors all referring to Openssl.

    Please let me know if you have a solution to get PHP 5.6 properly running on Debian 9. Thanks in advance for your help!
     
  2. HSorgYves

    HSorgYves Active Member

  3. ChuckSC

    ChuckSC New Member

    Thank you, HSorgYves.

    Apparently I was able to patch it properly and move on. Now "make" is blocking on the following:

    Code:
    [...] -I/usr/include -g -O2 -fvisibility=hidden  -c /usr/local/src/php5-build/php-5.6.31/ext/phar/util.c -o ext/phar/util.lo
    /usr/local/src/php5-build/php-5.6.31/ext/phar/util.c: In function ‘phar_verify_signature’:
    /usr/local/src/php5-build/php-5.6.31/ext/phar/util.c:1534:15: error: storage size of ‘md_ctx’ isn’t known
        EVP_MD_CTX md_ctx;
                   ^~~~~~
    /usr/local/src/php5-build/php-5.6.31/ext/phar/util.c:1633:5: warning: implicit declaration of function ‘EVP_MD_CTX_cleanup’ [-Wimplicit-function-declaration]
         EVP_MD_CTX_cleanup(&md_ctx);
         ^~~~~~~~~~~~~~~~~~
    Makefile:1343: recipe for target 'ext/phar/util.lo' failed
    make: *** [ext/phar/util.lo] Error 1
    
    But apparently after some research this could also be linked to Openssl, can anyone confirm?

    Thanks again.
     
  4. HSorgYves

    HSorgYves Active Member

    The previous posted patch should have solved that:
    Code:
    -            EVP_MD_CTX md_ctx;
    +            EVP_MD_CTX *md_ctx;
    Code:
    -            EVP_MD_CTX_cleanup(&md_ctx);
    +            EVP_MD_CTX_destroy(md_ctx);
     
  5. Jesse Norell

    Jesse Norell Well-Known Member

  6. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    indeed, I use that on some servers for old-as-f php scripts - some use even older ioncube protection ... no support from vendor ( orly ^^ ). works pretty well.

    If however your customer or whoever is using other php-version from default and has cronjobs setup, remember to either alter the path to php-cli binary or make the old default ( check other stuff running on your sys which might have issue with that )
    update-alternatives --config php
     

Share This Page