Adding PHP7-4.0 to Existing Server

Discussion in 'Installation/Configuration' started by pssadm, Oct 26, 2020.

  1. pssadm

    pssadm Member

    Hi all,

    I followed the instructions at: https://www.howtoforge.com/tutorial/how-to-compile-and-install-php-7.4-on-ubuntu-18-04/ in order to add php-7.4 to the available PHP versions. But for some reason, there seems to be things missing as an implementation of Nextcloud (which runs a site within ISPCONFIG 3) is missing modules or something that passes location services etc...

    Also, I noticed that the folder structure that the above instructions provide deposits the php files in the /OPT directory when the original perfect service instruction at https://www.howtoforge.com/tutorial...pureftpd-bind-postfix-doveot-and-ispconfig/2/ has them in the /ETC directory. The opt folder does not make reference to apache or available mods. Are there any other instructions to add php7.4 that I may be missing?
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    pssadm likes this.
  3. pssadm

    pssadm Member

    Thanks for the fast response Taleman. The link is still broken, but I found it in Google's cache. I'll post it here for others that might be interested. I'll follow-up on this post when tested. ;)

    Code:
    Installing several PHP versions with ispconfig3 and Ubuntu 18.04
    
     gOOvER
     Apr 22nd 2019
     0 Comments
     218 Views
    Since spam comments have been abused, it is necessary to register to leave comments
    With ispconfig3 we have the ability to manage and install multiple PHP versions to map these individual webs. Here I show you how to do it the easiest way.
    
    
    Contents [hideshow]
    1. Bring system up to date
    2. Add Sury.org to the source.list
    3. Install PHP versions
    4. Reset PHP to default in Ubuntu
    5. Setup in ispconfig3
    6. Restarts of services
    These steps MUST be performed as ROOT.
    
    It must be clear to everyone that PHP is updated to the latest version and the maintainer packages are overwritten.
    
    1. Bring system up to date
    
    
    
    Code
    apt-get update
    apt-get upgrade
    2. Add Sury.org to the source.list
    
    Code
    apt-get install apt-transport-https lsb-release ca-certificates
    add-apt-repository ppa:ondrej/php
    apt-get update
    apt-get upgrade
    
    
    3. Install PHP versions
    
    As of PHP 7.2, the "php-mycrpt" package is no longer available
    
    
    
    
    
    PHP 5.6:
    
    Code
    apt-get -y install php5.6 php5.6-common php5.6-fpm php5.6-gd php5.6-mysql php5.6-imap php5.6-cli php5.6-cgi php-pear 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 php-memcache php-imagick php-gettext php5.6-zip php5.6-mbstring php5.6-soap php5.6-common php5.6-opcache php5.6-mysql
    
    
    PHP 7.0
    
    Code
    apt-get -y install php7.0 php7.0-common php7.0-fpm php7.0-gd php7.0-mysql php7.0-imap php7.0-cli php7.0-cgi php-pear 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 php-memcache php-imagick php-gettext php7.0-zip php7.0-mbstring php7.0-soap php7.0-common php7.0-opcache php7.0-mysql
    
    
    PHP 7.1
    
    Code
    apt-get -y install php7.1 php7.1-common php7.1-fpm php7.1-gd php7.1-mysql php7.1-imap php7.1-cli php7.1-cgi php-pear 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 php-memcache php-imagick php-gettext php7.1-zip php7.1-mbstring php7.1-soap php7.1-common php7.1-opcache php7.1-mysql
    
    
    PHP 7.2
    
    Code
    apt-get -y install php7.2 php7.2-common php7.2-fpm php7.2-gd php7.2-mysql php7.2-imap php7.2-cli php7.2-cgi php-pear php7.2-curl php7.2-intl php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy php7.2-xmlrpc php7.2-xsl php-memcache php-imagick php-gettext php7.2-zip php7.2-mbstring php7.2-soap php7.2-common php7.2-opcache php7.2-mysql
    
    
    PHP 7.3
    
    Code
    apt-get -y install php7.3 php7.3-common php7.3-fpm php7.3-gd php7.3-mysql php7.3-imap php7.3-cli php7.3-cgi php-pear php7.3-curl php7.3-intl php7.3-pspell php7.3-recode php7.3-sqlite3 php7.3-tidy php7.3-xmlrpc php7.3-xsl php-memcache php-imagick php-gettext php7.3-zip php7.3-mbstring php7.3-soap php7.3-common php7.3-opcache php7.3-mysql
    
    
    4. Reset PHP to default in Ubuntu
    
    By installing the new PHP packages, the default PHP version in Debian has been changed to the latest PHP version. This can cause problems with some applications, so we reset it to default.
    
    
    
    
    
    For Ubuntu 18.04 we choose: PHP 7.2
    
    
    
    
    
    DO BOTH commands and set BOTH to DEFAULT:
    
    Code
    update-alternatives --config php
    update-alternatives --config php-cgi
    5. Setup in ispconfig3
    
    We log in with an ADMIN account in ispconfig.
    
    
    
    
    
    Then we navigate to:
    
    
    
    
    
     
    
    
    There we add by adding: "Add new PHP version", one after the other:
    
    
    
    PHP 5.6
    
    
    
    Tab "Name"
    Server: Select the server here
    
    Name: Give a name here
    
    
    
    Tab "FastCGI Settings"
    
    Path to PHP FastCGI Binary: php5.6-cgi
    
    Path to the php.ini directory: /etc/php/5.6/cgi/php.ini
    
    
    
    Tab "FPM Settings"
    
    Path to PHP-FPM init Script: php5.6-fpm
    
    Path of the php.ini directory: /etc/php/5.6/fpm/php.ini
    
    Path to PHP-FPM Pool Directory: /etc/php/5.6/fpm/pool.d
    
    
    
    
    
    PHP 7.0
    
    
    
    Tab "Name"
    Server: Select the server here
    Name: Give a name here
    
    
    
    Tab "FastCGI Settings"
    
    Path to PHP FastCGI Binary: php7.0-cgi
    
    Path to the php.ini directory: /etc/php/7.0/cgi/php.ini
    
    
    
    Tab "FPM Settings"
    
    Path to PHP-FPM init Script: php7.0-fpm
    
    Path of the php.ini directory: /etc/php/7.0/fpm/php.ini
    
    Path to PHP-FPM Pool Directory: /etc/php/7.0/fpm/pool.d
    
    
    
    
    
    PHP 7.1
    
    
    
    Tab "Name"
    Server: Select the server here
    Name: Give a name here
    
    
    Tab "FastCGI Settings"
    
    Path to PHP FastCGI Binary: php7.1-cgi
    
    Path to the php.ini directory: /etc/php/7.1/cgi/php.ini
    
    
    
    Tab "FPM Settings"
    
    Path to PHP-FPM init Script: php7.1-fpm
    
    Path of the php.ini directory: /etc/php/7.1/fpm/php.ini
    
    Path to PHP-FPM Pool Directory: /etc/php/7.1/fpm/pool.d
    
    
    
    
    
    PHP 7.2
    
    
    
    Tab "Name"
    Server: Select the server here
    Name: Give a name here
    
    
    Tab "FastCGI Settings"
    
    Path to PHP FastCGI Binary: php7.2-cgi
    
    Path to the php.ini directory: /etc/php/7.2/cgi/php.ini
    
    
    
    Tab "FPM Settings"
    
    Path to PHP-FPM init Script: php7.2-fpm
    
    Path of the php.ini directory: /etc/php/7.2/fpm/php.ini
    
    Path to PHP-FPM Pool Directory: /etc/php/7.2/fpm/pool.d
    
    
    
    
    
    PHP 7.3
    
    
    
    Tab "Name"
    Server: Select the server here
    Name: Give a name here
    
    Tab "FastCGI Settings"
    
    Path to PHP FastCGI Binary: php7.3-cgi
    
    Path to the php.ini directory: /etc/php/7.3/cgi/php.ini
    
    
    
    Tab "FPM Settings"
    
    Path to PHP-FPM init script: php7.3-fpm
    
    Path of the php.ini directory: /etc/php/7.3/fpm/php.ini
    
    Path to PHP-FPM Pool Directory: /etc/php/7.3/fpm/pool.d
    
    
    
    Thus, all versions are registered in ispconfig and can be used individually from now on.
    
    6. Restarts of services
    
    Now all services are being restarted:
    
    
    
    
    
    Code
    systemctl restart php5.6-fpm
    systemctl restart php7.0-fpm
    systemctl restart php7.1-fpm
    systemctl restart php7.2-fpm
    systemctl restart php7.3-fpm
    systemctl restart apache2
    
     
    budgierless likes this.
  4. pssadm

    pssadm Member

    As I follow thru the add-apt-repository ppa: ondrej/php a message pops up as follows. I'm not sure if to proceed or alter the command as I know my ISPConfig implementation is using Apache2. UPDATE: I proceeded without updating number 2 and followed the instructions to the end. WORKED PERFECTLY!!

     
    Last edited: Oct 27, 2020
  5. pssadm

    pssadm Member

    FOLLOW-UP: It worked perfectly. Very easy to follow instructions. So if you need another module for any of the versions, it's a simple apt-get install phpX.Y-module name. By the way, it worked all the way up to 7.4 for anyone who is interested.

    Thanks so much for the pointer Taleman!!
     
  6. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    should also work right now for php8.0, should install php8.0 release candidates, and update it to the full php8.0 when it's officially released.
     

Share This Page