PHP 8 / Ubuntu / NGINX

Discussion in 'ISPConfig 3 Priority Support' started by molahs, May 24, 2021.

  1. molahs

    molahs Member HowtoForge Supporter

    Hi,
    I was looking for a guide to install PHP 8 on Ubuntu with NGINX (with ISPC of course)
    Are there any special instructions to do it or a step by step guide available?
    TIA
     
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

  3. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    (UBUNTU ONLY) Add the Sury repo:
    Code:
    sudo add-apt-repository ppa:ondrej/php
    sudo apt-get update
    To install PHP 8, run
    Code:
    apt install php8.0 php8.0-cli php8.0-cgi php8.0-fpm php8.0-gd php8.0-mysql php8.0-imap php8.0-curl php8.0-intl php8.0-pspell php8.0-sqlite3 php8.0-tidy php8.0-xsl php8.0-zip php8.0-mbstring php8.0-soap php8.0-opcache libonig5 php8.0-common php8.0-readline php8.0-xml
    In ISPConfig 3, you can configure the new PHP versions under System > Additional PHP Versions. Add a new version with these settings:
    Path to the PHP FastCGI binary: php-cgi8.0
    Path to the php.ini directory: /etc/php/8.0/cgi/php.ini
    Path to the PHP-FPM init script: php8.0-fpm
    Path to the php.ini directory: /etc/php/8.0/fpm/php.ini
    Path to the PHP-FPM pool directory: /etc/php/8.0/fpm/pool.d

    The default PHP of the operating system has to remain at the original version. To fix that, run these commands:
    update-alternatives --config php
    update-alternatives --config php-cgi

    and set it to the default PHP version for your Ubuntu release (Ubuntu 18.04: PHP 7.2, Ubuntu 20.04: PHP 7.4)
     
    ahrasis, molahs and Jesse Norell like this.
  4. molahs

    molahs Member HowtoForge Supporter

    Fantastic. Thanks!
     
  5. molahs

    molahs Member HowtoForge Supporter

    When trying to run the code above I get:
    Code:
    [email protected]:/# apt install php8.0 php8.0-cli php8.0-cgi php8.0-fpm php8.0-gd php8.0-mysql php8.0-imap php8.0-curl php8.0-intl php8.0-pspell php8.0-sqlite3 php8.0-tidy php8.0-xsl php8.0-zip php8.0-mbstring php8.0-soap php8.0-opcache libonig5  php8.0-common php8.0-readline php8.0-xml
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Unable to locate package libonig5
    
    I am running on Ubuntu 18.04.5 LTS.
    Am I missing something?
     
  6. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Remove that package from the command and retry.
     
    molahs likes this.

Share This Page