Install php7.0 & php5.6 ONLY

Discussion in 'Installation/Configuration' started by emad, May 2, 2017.

  1. emad

    emad Member

    While installing a new perfect server (Ubuntu 16.04) and because Ubuntu 16.04 comes with php7.0, At the end I get the system with php7.0 (only) which is incompatible with most of websites now. So I need to install php5.6 alongside with php7.0. (as I know) The best source of php5.6 is the PPA (https://launchpad.net/~ondrej/+archive/ubuntu/php) which contains three versions 5.6, 7.0 & 7.1.

    The problem is, after adding the PPA and trying to install/update the system apt/aptitude forces installing of php7.1 which I don't want, I want to stay with version 7.0 from Ubuntu to get the official updates, and I want php5.6 (only) aslo. I don't want version 7.0 nor 7.1 from the PPA.

    How to avoid php7.0 & php7.1 from the PPA ?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig expects to find the PHP version that belongs as default to an operating system, and that is PHP 7.0 on Ubuntu 16.04. Installing PHP 5.6 only will just break your server as ISPConfig will fail to find PHP in it's default directories. Instead of touching the main php, just install an additional PHP 5.6 version. You can then select the PHP version for each website, and most CMS systems do support PHP 7 today and even more systems adopt php 7, so having it installed is a good choice for the future anyway, even if some of your sites don't support it yet.
     
  3. emad

    emad Member

    @till Sorry, If I wasn't clear enough,
    .
    What I want is exactly what you've suggested, I want the original version 7.0 with version 5.6, I want both.

    The problem is: version 7.1 is forced to install, and the original version 7.0 is forced to update from the PPA.

    - I want the original package php7.0 (from Ubuntu) and php5.6 from the PPA.
    - Version 7.0 from PPA and 7.1 are forced from the PPA, how to avoid this forcing?

    Have a look at the output of Atitude (so does apt), I didn't request any 7.1 package !

    Code:
    $: aptitude install apache2 apache2-doc apache2-utils libapache2-mod-php php7.0 php7.0-common php7.0-gd php7.0-mysql php7.0-imap phpmyadmin php7.0-cli php7.0-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear php-auth php7.0-mcrypt mcrypt  imagemagick libruby libapache2-mod-python php7.0-curl php7.0-intl php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl memcached php-memcache php-imagick php-gettext php7.0-zip php7.0-mbstring
    The following NEW packages will be installed:
      apache2 apache2-bin{a} apache2-data{a} apache2-doc apache2-suexec-pristine apache2-utils aspell{a} aspell-en{a} dbconfig-common{a} dbconfig-mysql{a} fontconfig{a}
      fontconfig-config{a} fonts-dejavu-core{a} fonts-lato{a} ghostscript{a} gsfonts{a} hicolor-icon-theme{a} imagemagick imagemagick-6.q16{a} imagemagick-common{a}
      javascript-common{a} libaio1{a} libapache2-mod-fcgid libapache2-mod-php libapache2-mod-php7.1{a} libapache2-mod-python libapr1{a} libaprutil1{a} libaprutil1-dbd-sqlite3{a}
      libaprutil1-ldap{a} libaspell15{a} libavahi-client3{a} libavahi-common-data{a} libavahi-common3{a} libc-client2007e{a} libcairo2{a} libcroco3{a} libcups2{a}
      libcupsfilters1{a} libcupsimage2{a} libcurl3{a} libdatrie1{a} libdjvulibre-text{a} libdjvulibre21{a} libevent-2.0-5{a} libfftw3-double3{a} libfontconfig1{a} libgd3{a}
      libgdk-pixbuf2.0-0{a} libgdk-pixbuf2.0-common{a} libgomp1{a} libgraphite2-3{a} libgs9{a} libgs9-common{a} libharfbuzz0b{a} libijs-0.35{a} libilmbase12{a} libjbig0{a}
      libjbig2dec0{a} libjpeg-turbo8{a} libjpeg8{a} libjs-jquery{a} libjs-sphinxdoc{a} libjs-underscore{a} liblcms2-2{a} liblqr-1-0{a} libltdl7{a} liblua5.1-0{a}
      libmagickcore-6.q16-2{a} libmagickcore-6.q16-2-extra{a} libmagickwand-6.q16-2{a} libmcrypt4{a} libmhash2{a} libnetpbm10{a} libopenexr22{a} libpango-1.0-0{a}
      libpangocairo-1.0-0{a} libpangoft2-1.0-0{a} libpaper-utils{a} libpaper1{a} libpixman-1-0{a} libpython2.7{a} librecode0{a} librsvg2-2{a} librsvg2-common{a} libruby
      libruby2.3{a} libthai-data{a} libthai0{a} libtidy5{a} libtiff5{a} libwebp5{a} libwmf0.2-7{a} libxcb-render0{a} libxcb-shm0{a} libxmlrpc-epi0{a} libxpm4{a} libxrender1{a}
      libxslt1.1{a} libyaml-0-2{a} libzip4{a} mcrypt memcached mlock{a} mysql-client{a} mysql-client-5.7{a} mysql-client-core-5.7{a} mysql-common{a} netpbm{a} php-auth
      php-auth-sasl{a} php-common{a} php-crypt-chap{a} php-db{a} php-gettext php-imagick php-log{a} php-mail{a} php-mdb2{a} php-memcache php-net-smtp{a} php-net-socket{a} php-pear
      php-phpseclib{a} php-soap{a} php-tcpdf{a} php-xml{a} php7.0 php7.0-cgi php7.0-cli php7.0-common php7.0-curl php7.0-gd php7.0-imap php7.0-intl php7.0-json{a} php7.0-mbstring
      php7.0-mcrypt php7.0-mysql php7.0-opcache{a} php7.0-pspell php7.0-readline{a} php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xml{a} php7.0-xmlrpc php7.0-xsl php7.0-zip
      php7.1-cli{a} php7.1-common{a} php7.1-json{a} php7.1-opcache{a} php7.1-readline{a} php7.1-soap{a} php7.1-xml{a} phpmyadmin poppler-data{a} rake{a} ruby{a}
      ruby-did-you-mean{a} ruby-minitest{a} ruby-net-telnet{a} ruby-power-assert{a} ruby-test-unit{a} ruby2.3{a} rubygems-integration{a} ssl-cert{a} ttf-dejavu-core{a} unzip{a}
      zip{a}
    0 packages upgraded, 171 newly installed, 0 to remove and 0 not upgraded.
    Need to get 64.9 MB of archives. After unpacking 307 MB will be used.
    Do you want to continue? [Y/n/?]
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, sorry. I misread your post :)

    The ondrej ppa installs php 7.1 beside php 7.0. You should be able to make php 7.0 the default again by using:

    sudo update-alternatives --set php /usr/bin/php7.0
     
  5. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I am using the same ondrej ppa with all three php versions enabled and the guide to change default php is as stated by @till above. Except for ISPC (php7.0) and AvantFax(php5.6), I am using php7.1 for all websites / apps instead of php7.0. I didn't face any major issues in my private server so far.
     
  6. pongraczi

    pongraczi Member

    Owncloud / Magento still needs lower version of php, but following this tutorial it is not a big deal to compile and install other php versions.
    There is a helper python program around this forum, which can compile it automatically, it is a great one (except, if someone needs more features compiled in, such as intl, postgres support etc.).
    I use debian 8 otherwise.
     
    ahrasis likes this.

Share This Page