[SOLVED] Ubuntu 14.04 + PHP 7.1

Discussion in 'Installation/Configuration' started by MITDK, Jul 3, 2018.

  1. MITDK

    MITDK New Member

    Hi,
    I have a case, where "The Perfect Server Ubuntu 14.04" image has been used, where PHP 5.5.x is default.
    Now I want to add PHP 7.1 as an additional, but I keeps failing. I'm using this guide: https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/ (I know it's for Debian..) I downloaded the PHP 7.1.18 version.

    The problem starts from step 3, the "./configure --prefix=/opt/php-7.1 ......" I've fixed 8 missing modules, but it keeps failing. I'm unable to proceed with "make -> make install"

    I've searched the web, and this forum for hours, without any solution yet. I hope that someone can point to in the right direction, to get PHP 7.1 installed as an additional package. Also PHP 5.6, if possible.

    Thanks
     
  2. Jesse Norell

    Jesse Norell Well-Known Member

  3. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    ahrasis likes this.
  4. MITDK

    MITDK New Member

    It's kinda impossible, to post the errors. Because each time I fix a missing module, another one comes up with error / missing.
    Currently having these mods installed @ attachment.
    Can anyone provide me information for adding PHP 5.6 + 7.1? Upgrading Ubuntu from 14.04 LTS ain't gonna be nice ..
     

    Attached Files:

  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Ondre Sury has done the building of PHP for different Ubuntu versions. Instead of learning how to do the build yourself, use the ready packages from Ondrej Sury's Ubuntu repo. Like @Jesse Norell and me have already advised.
     
  6. ahrasis

    ahrasis Well-Known Member

    I already replied to almost similar questions in here and there where in short, you can use this to install for all four php (5.6, 7.0, 7.1 and 7.2):
    Code:
    apt-get -y install php5.6-opcache php5.6-soap php5.6-fpm php5.6 php5.6-common php5.6-gd php5.6-mysql php5.6-imap php5.6-cli php5.6-cgi php5.6-mcrypt php5.6-curl php5.6-intl php5.6-pspell php5.6-recode php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl php5.6-zip php5.6-mbstring php7.0-opcache php7.0-soap php7.0-fpm php7.0 php7.0-common php7.0-gd php7.0-mysql php7.0-imap php7.0-cli php7.0-cgi php7.0-mcrypt php7.0-curl php7.0-intl php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-zip php7.0-mbstring php7.1-opcache php7.1-soap php7.1-fpm php7.1 php7.1-common php7.1-gd php7.1-mysql php7.1-imap php7.1-cli php7.1-cgi php7.1-mcrypt php7.1-curl php7.1-intl php7.1-pspell php7.1-recode php7.1-sqlite3 php7.1-tidy php7.1-xmlrpc php7.1-xsl php7.1-zip php7.1-mbstring php7.2-opcache php7.2-soap php7.2-fpm php7.2 php7.2-common php7.2-gd php7.2-mysql php7.2-imap php7.2-cli php7.2-cgi mcrypt imagemagick libruby php7.2-curl php7.2-intl php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy php7.2-xmlrpc php7.2-xsl memcached php-memcache php-imagick php-gettext php7.2-zip php7.2-mbstring
    Then, create the additional php settings in your ISPConfig as shown in here or in the link given by @Jesse Norell above.
     
    MITDK likes this.
  7. MITDK

    MITDK New Member

    Thanks, almost what I wanted :)
    - but it seems that PHP 5.5.x got upgraded to 5.6 with this?

    Where to define the "Default" PHP value?
    How to change ISPConfig website to using PHP 7.1?
     
    Last edited: Jul 4, 2018
  8. MITDK

    MITDK New Member

    Another thing to this:

    NOTICE: Not enabling PHP 5.6 FPM by default.
    NOTICE: To enable PHP 5.6 FPM in Apache2 do:
    NOTICE: a2enmod proxy_fcgi setenvif
    NOTICE: a2enconf php5.6-fpm
    NOTICE: You are seeing this message because you have apache2 package installed.
    php5.6-fpm stop/waiting
    php5.6-fpm start/running, process XXXXX
    Processing triggers for php7.1-fpm (7.1.18-1+ubuntu14.04.1+deb.sury.org+1) ...
    php7.1-fpm stop/waiting
    php7.1-fpm start/running, process XXXXX
    NOTICE: Not enabling PHP 7.1 FPM by default.
    NOTICE: To enable PHP 7.1 FPM in Apache2 do:
    NOTICE: a2enmod proxy_fcgi setenvif
    NOTICE: a2enconf php7.1-fpm
    NOTICE: You are seeing this message because you have apache2 package installed.

    I can fine choose between PHP 5.6 and PHP 7.1 in ISPConfig now. Do I have to do more, I mean the stuff from the notice lines?
     
  9. Jesse Norell

    Jesse Norell Well-Known Member

    For cli php it uses the system path, so `which php` will tell you what your default is, hopefully still /usr/bin/php. For both cli and cgi mode you use update-alternatives to set the default version; I believe there are instructions in the comments to the tutorial I linked to.

    For client websites, the default is whatever you have under System > Server Config > {webserver} > Web > PHP Settings.

    No, that changes the default php version that apache will use to the corresponding php-fpm versions, just leave the system default (probably mod_php). If you run any shared apps (eg. roundcube or phpmyadmin) on the webserver, they'll need to work with this mode; iirc, you can switch to php-fpm, but it requires a little configuration to work correctly (seems like @ztk.me posted some instructions on doing do in the past; I've not tried it yet)


    On an explanatory note (not applicable to your ubuntu 14.04, but to see how it comes into play), after upgrading debian 8 to 9, where the system php changed from 5.6 to 7.0, I both ran update-alternatives to switch the default cli and cgi versions, as well as changed the PHP Settings for the webserver. And in checking right now, I actually have version 7.2 of mod_php in use (for roundcube/phpmydadmin), which is probably an oversight (I would usually just go with 7.0, the system default), but I don't know of any problems with it offhand. (Also possibly relevant, this webserver does not host the ispconfig control panel, just client sites + shared apps.)
     
  10. ahrasis

    ahrasis Well-Known Member

    I am not sure as you should have both but the said PPA do support only php5.6 and above. In my experience, most websites that requires php5 should be working fine with php5.6.
    For your apache2 server, I think it should be:
    Code:
    sudo a2dismod php5 # or php5.6
    sudo a2enmod php7.2 # whatever latest php that you installed
    sudo service apache2 restart
    For clients, refer to the above (link and advise) by @Jesse Norell.
    I think you can't do that after ISPConfig website is installed as it will be using the system default for Ubuntu 14.04 that is php5. To use other php for ISPConfig website before installing, one will need to modify the installation file which is not advisable. There may also be a way to do it after the installation but that is also not advisable.

    In any event, support for Ubuntu 14.04 is up to 2019, so I really think the best is to migrate your server to the latest LTS which is Ubuntu 18.04 (tutorial for building it is also available). You can still use php5.6 for website that requires php5 by using the said PPA.
     
    Last edited: Jul 6, 2018
  11. MITDK

    MITDK New Member

    Thanks guys.
    Problem solved =)
     

Share This Page