How to replace PHP5 with PHP7 on a ISPCFG3 server?

Discussion in 'General' started by Ovidiu, Jan 21, 2020.

Tags:
  1. Ovidiu

    Ovidiu Active Member

    Does anyone have a quick guide? I don't want both so I am thinking of something along the lines of:
    - list all php5 related packages
    - remove them
    - replace them with the php7 version
    reboot

    I am using Debian 9, ISPCFG3 and nginx. Only hosting wordpress site and they are all php7 compatible.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Install the new PHP version as an additional PHP version and then select it in the websites. The default version of the server should remain at the default version that ships with the operating system version that you use, for Debian 9, PHP 7.0 btw. and not PHP 5.
     
  3. Ovidiu

    Ovidiu Active Member

    is this the recommended best practice? I just thought that only having 1 version would help avoid problems.
    Would this be the right tutorial: https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/ ?
    Also I see already compiled packages:
    Code:
    apt-cache search php7.0
    libapache2-mod-php7.0 - server-side, HTML-embedded scripting language (Apache 2 module)
    libphp7.0-embed - HTML-embedded scripting language (Embedded SAPI library)
    php-all-dev - package depending on all supported PHP development packages
    php7.0 - server-side, HTML-embedded scripting language (metapackage)
    php7.0-apcu - APC User Cache for PHP
    php7.0-apcu-bc - APCu Backwards Compatibility Module
    php7.0-bcmath - Bcmath module for PHP
    ...
    but a search for php5 also has results:
    Code:
    apt-cache search php5 | more
    bluefish - advanced Gtk+ text editor for web and software development
    root@alfred:~# apt-cache search php5- | more
    bluefish - advanced Gtk+ text editor for web and software development
    php5-exactimage - fast image manipulation library (PHP bindings)
    php5-gdcm - Grassroots DICOM PHP5 bindings
    php5-vtkgdcm - Grassroots DICOM VTK PHP bindings
    php5-geos - GEOS bindings for PHP
    php5-lasso - Library for Liberty Alliance and SAML protocols - PHP 5 bindings
    php5-libvirt-php - libvirt bindings for PHP
    php5-mapscript - php5-cgi module for MapServer
    ...
    its php 5.6.x - can't remember the full history of this server but it might have been upgraded from Debian 8 hence php 5.6.x?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    yes. All PHP based applications on your server incl. ISPConfig expects that the default PHP version of the OS is the one that ships with the OS as these applications are tested against that versions, using a different version may lead to errors.
     
  5. Ovidiu

    Ovidiu Active Member

  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Ovidiu likes this.
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    As @Taleman suggested, you can get ready compiled packages from sury.org.
     
    Ovidiu likes this.
  8. Ovidiu

    Ovidiu Active Member

    Thanks for the link, I quickly skimmed it and that sounds better, thanks!
    Compiling myself was exactly what I was afraid of (I mean the overhead) hence my insistent question if I can't use apt-get :)
     
  9. Ovidiu

    Ovidiu Active Member

    Hi everyone,

    I only got around to try and install PHP 7.4 in addition to PHP 5.6 now and had to realize the tutorial linked here isn't working anymore because sury stopped offering PHP for Debian Jessie.

    I know it is old and the server will be replaced soon, I just need PHP4 for a few more weeks - any other way to get PHP 7.4 running on Debian Jessie?
     
  10. Ovidiu

    Ovidiu Active Member

  11. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Yes, either upgrade your current server OS to the latest or migrate to new server with latest OS, then fix your php for ISPConfig to use the one that come with the latest OS.
     

Share This Page