install php 8.1

Discussion in 'Installation/Configuration' started by mccharlet, Dec 7, 2021.

  1. mccharlet

    mccharlet Member HowtoForge Supporter

    Hi,
    I installed ispconfig 3.2 with the automatical script and php 7.4 et php 8.0.
    Now i want add php 8.1.
    How to add this version ?
    Thanks for your support
    Best regards
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The command is:

    Code:
    apt-get install php8.1 php8.1-cli php8.1-cgi php8.1-fpm php8.1-gd php8.1-mysql php8.1-imap php8.1-curl php8.1-intl php8.1-pspell php8.1-sqlite3 php8.1-tidy php8.1-xsl php8.1-zip php8.1-mbstring php8.1-soap php8.1-opcache libonig5 php8.1-common php8.1-readline php8.1-xml
    Then login to ISPConfig and add it under System > PHP versions. Use the settings from PHP 8 version as an example and just replace 8.0 with 8.1 in all paths.
     
    ahrasis and mccharlet like this.
  3. DragonZX

    DragonZX New Member

    Hello please advise me. After trying to upgrade php to 8.1 I get in the Apache 2 main error log:
    Code:
    [Sat Dec 11 11:35:11.566154 2021] [mpm_prefork:notice] [pid 479] AH00163: Apache/2.4.51 (Debian) mod_fcgid/2.3.9 Phusion_Passenger/5.0.30 OpenSSL/1.1.1k configured -- resuming normal operations
    [Sat Dec 11 11:35:11.566177 2021] [core:notice] [pid 479] AH00094: Command line: '/usr/sbin/apache2'
    [Sat Dec 11 11:35:55.824693 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:4627] mod_fcgid: stderr: PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366) : eval()'d code:116, referer: https://server.example.com:15000/login/
    [Sat Dec 11 11:35:55.824715 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:4627] mod_fcgid: stderr: Stack trace:, referer: https://server.example.com:15000/login/
    [Sat Dec 11 11:35:55.824718 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:4627] mod_fcgid: stderr: #0 /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366): eval(), referer: https://server.example.com:15000/login/
    [Sat Dec 11 11:35:55.824721 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:4627] mod_fcgid: stderr: #1 /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(769): tpl->_parse(), referer: https://server.example.com:15000/login/
    [Sat Dec 11 11:35:55.824724 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:4627] mod_fcgid: stderr: #2 /usr/local/ispconfig/interface/web/index.php(117): tpl->pparse(), referer: https://server.example.com:15000/login/
    [Sat Dec 11 11:35:55.824726 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:4627] mod_fcgid: stderr: #3 {main}, referer: https://server.example.com:15000/login/
    [Sat Dec 11 11:35:55.824729 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:4627] mod_fcgid: stderr:   thrown in /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366) : eval()'d code on line 116, referer: https://server.example.com:15000/login/
    [Sat Dec 11 11:35:56.949130 2021] [fcgid:warn] [pid 558] [client 127.0.0.1:4630] mod_fcgid: stderr: PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366) : eval()'d code:116, referer: https://server.example.com:15000/login/
    [Sat Dec 11 11:35:56.949149 2021] [fcgid:warn] [pid 558] [client 127.0.0.1:4630] mod_fcgid: stderr: Stack trace:, referer: https://server.example.com:15000/login/
    [Sat Dec 11 11:35:56.949152 2021] [fcgid:warn] [pid 558] [client 127.0.0.1:4630] mod_fcgid: stderr: #0 /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366): eval(), referer: https://server.example.com:15000/login/
    [Sat Dec 11 11:35:56.949155 2021] [fcgid:warn] [pid 558] [client 127.0.0.1:4630] mod_fcgid: stderr: #1 /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(769): tpl->_parse(), referer: https://server.example.com:15000/login/
    [Sat Dec 11 11:35:56.949157 2021] [fcgid:warn] [pid 558] [client 127.0.0.1:4630] mod_fcgid: stderr: #2 /usr/local/ispconfig/interface/web/index.php(117): tpl->pparse(), referer: https://server.example.com:15000/login/
    [Sat Dec 11 11:35:56.949159 2021] [fcgid:warn] [pid 558] [client 127.0.0.1:4630] mod_fcgid: stderr: #3 {main}, referer: https://server.example.com:15000/login/
    [Sat Dec 11 11:35:56.949162 2021] [fcgid:warn] [pid 558] [client 127.0.0.1:4630] mod_fcgid: stderr:   thrown in /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366) : eval()'d code on line 116, referer: https://server.example.com:15000/login/
    [Sat Dec 11 11:36:06.519872 2021] [fcgid:warn] [pid 557] [client 127.0.0.1:4637] mod_fcgid: stderr: PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366) : eval()'d code:116
    [Sat Dec 11 11:36:06.519891 2021] [fcgid:warn] [pid 557] [client 127.0.0.1:4637] mod_fcgid: stderr: Stack trace:
    [Sat Dec 11 11:36:06.519894 2021] [fcgid:warn] [pid 557] [client 127.0.0.1:4637] mod_fcgid: stderr: #0 /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366): eval()
    [Sat Dec 11 11:36:06.519897 2021] [fcgid:warn] [pid 557] [client 127.0.0.1:4637] mod_fcgid: stderr: #1 /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(769): tpl->_parse()
    [Sat Dec 11 11:36:06.519900 2021] [fcgid:warn] [pid 557] [client 127.0.0.1:4637] mod_fcgid: stderr: #2 /usr/local/ispconfig/interface/web/index.php(117): tpl->pparse()
    [Sat Dec 11 11:36:06.519903 2021] [fcgid:warn] [pid 557] [client 127.0.0.1:4637] mod_fcgid: stderr: #3 {main}
    [Sat Dec 11 11:36:06.519905 2021] [fcgid:warn] [pid 557] [client 127.0.0.1:4637] mod_fcgid: stderr:   thrown in /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366) : eval()'d code on line 116
    [Sat Dec 11 12:43:53.852646 2021] [fcgid:warn] [pid 750] [client 127.0.0.1:1269] mod_fcgid: stderr: PHP Warning:  Undefined array key "user" in /usr/local/ispconfig/interface/web/index.php on line 35
    [Sat Dec 11 12:43:53.852674 2021] [fcgid:warn] [pid 750] [client 127.0.0.1:1269] mod_fcgid: stderr: PHP Warning:  Trying to access array offset on value of type null in /usr/local/ispconfig/interface/web/index.php on line 35
    [Sat Dec 11 12:43:53.961567 2021] [fcgid:warn] [pid 750] [client 127.0.0.1:1269] mod_fcgid: stderr: PHP Warning:  Undefined array key "user" in /usr/local/ispconfig/interface/web/login/index.php on line 35
    [Sat Dec 11 12:43:53.961579 2021] [fcgid:warn] [pid 750] [client 127.0.0.1:1269] mod_fcgid: stderr: PHP Warning:  Trying to access array offset on value of type null in /usr/local/ispconfig/interface/web/login/index.php on line 35
    [Sat Dec 11 12:43:53.961582 2021] [fcgid:warn] [pid 750] [client 127.0.0.1:1269] mod_fcgid: stderr: PHP Warning:  Undefined variable $custom_login in /usr/local/ispconfig/interface/web/login/index.php on line 371
    [Sat Dec 11 12:43:53.961590 2021] [fcgid:warn] [pid 750] [client 127.0.0.1:1269] mod_fcgid: stderr: PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366) : eval()'d code:88
    [Sat Dec 11 12:43:53.961593 2021] [fcgid:warn] [pid 750] [client 127.0.0.1:1269] mod_fcgid: stderr: Stack trace:
    [Sat Dec 11 12:43:53.961595 2021] [fcgid:warn] [pid 750] [client 127.0.0.1:1269] mod_fcgid: stderr: #0 /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366): eval()
    [Sat Dec 11 12:43:53.961598 2021] [fcgid:warn] [pid 750] [client 127.0.0.1:1269] mod_fcgid: stderr: #1 /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(769): tpl->_parse()
    [Sat Dec 11 12:43:53.961600 2021] [fcgid:warn] [pid 750] [client 127.0.0.1:1269] mod_fcgid: stderr: #2 /usr/local/ispconfig/interface/web/login/index.php(375): tpl->pparse()
    [Sat Dec 11 12:43:53.961602 2021] [fcgid:warn] [pid 750] [client 127.0.0.1:1269] mod_fcgid: stderr: #3 {main}
    [Sat Dec 11 12:43:53.961604 2021] [fcgid:warn] [pid 750] [client 127.0.0.1:1269] mod_fcgid: stderr:   thrown in /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366) : eval()'d code on line 88
    [Sat Dec 11 12:44:30.441646 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:1326] mod_fcgid: stderr: PHP Warning:  Undefined array key "user" in /usr/local/ispconfig/interface/web/login/index.php on line 35, referer: https://server.example.com:15000/login/
    [Sat Dec 11 12:44:30.441663 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:1326] mod_fcgid: stderr: PHP Warning:  Trying to access array offset on value of type null in /usr/local/ispconfig/interface/web/login/index.php on line 35, referer: https://server.example.com:15000/login/
    [Sat Dec 11 12:44:30.441666 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:1326] mod_fcgid: stderr: PHP Warning:  Trying to access array offset on value of type null in /usr/local/ispconfig/interface/web/login/index.php on line 143, referer: https://server.example.com:15000/login/
    [Sat Dec 11 12:44:30.617556 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:1326] mod_fcgid: stderr: PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366) : eval()'d code:116, referer: https://server.example.com:15000/login/
    [Sat Dec 11 12:44:30.617574 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:1326] mod_fcgid: stderr: Stack trace:, referer: https://server.example.com:15000/login/
    [Sat Dec 11 12:44:30.617577 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:1326] mod_fcgid: stderr: #0 /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366): eval(), referer: https://server.example.com:15000/login/
    [Sat Dec 11 12:44:30.617581 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:1326] mod_fcgid: stderr: #1 /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(769): tpl->_parse(), referer: https://server.example.com:15000/login/
    [Sat Dec 11 12:44:30.617584 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:1326] mod_fcgid: stderr: #2 /usr/local/ispconfig/interface/web/index.php(117): tpl->pparse(), referer: https://server.example.com:15000/login/
    [Sat Dec 11 12:44:30.617587 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:1326] mod_fcgid: stderr: #3 {main}, referer: https://server.example.com:15000/login/
    [Sat Dec 11 12:44:30.617590 2021] [fcgid:warn] [pid 759] [client 127.0.0.1:1326] mod_fcgid: stderr:   thrown in /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366) : eval()'d code on line 116, referer: https://server.example.com:15000/login/
    
    The sites, which uses PHP are working properly
    When I trying to reinstall:
    Code:
    PHP Warning:  Undefined array key "do_backup" in /tmp/update_runner.sh.nsy3uF6IYr/install/lib/installer_base.lib.php on line 86
    This application will update ISPConfig 3 on your server.
    
    PHP Warning:  Trying to access array offset on value of type null in /tmp/update_runner.sh.nsy3uF6IYr/install/lib/installer_base.lib.php on line 92
    Shall the script create a ISPConfig backup in /var/backup/ now? (yes,no) [yes]:
    
    Creating backup of "/usr/local/ispconfig" directory...
    Creating backup of "/etc" directory...
    Checking ISPConfig database .. OK
    Starting incremental database update.
    Loading SQL patch file: /tmp/update_runner.sh.nsy3uF6IYr/install/sql/incremental/upd_dev_collection.sql
    PHP Fatal error:  Uncaught mysqli_sql_exception: DROP command denied to user 'user'@'localhost' for table 'mainispdbsys_session' in /tmp/update_runner.sh.nsy3uF6IYr/install/lib/mysql.lib.php:234
    Stack trace:
    #0 /tmp/update_runner.sh.nsy3uF6IYr/install/lib/mysql.lib.php(234): mysqli_query()
    #1 /tmp/update_runner.sh.nsy3uF6IYr/install/lib/mysql.lib.php(271): db->_query()
    #2 /tmp/update_runner.sh.nsy3uF6IYr/install/lib/update.lib.php(412): db->query()
    #3 /tmp/update_runner.sh.nsy3uF6IYr/install/update.php(322): updateDbAndIni()
    #4 {main}
      thrown in /tmp/update_runner.sh.nsy3uF6IYr/install/lib/mysql.lib.php on line 234
    
    What should I do?
     
    Last edited: Dec 11, 2021
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    This thread here is not about upgrading PHP to 8.1, so do not run the commands above if your system does not use multiple PHP versions already and was not configured by the ISPConfig auto-installer.

    Downgrade again to fix your server if you really upgraded PHP to 8.1 by replacing the original PHP version. If you just install PHP 8.1 in addition to the correct original version, then you can choose the right version again by using update-alternatives command as shown in the guide below. The main PHP version of the system may not be upgraded at all. You can install PHP versions between 5.6 and 8.1 as additional PHP versions.

    See here on how to install additional PHP versions correctly: https://www.howtoforge.com/tutorial...fig-3-from-debian-packages-on-debian-8-and-9/
     
  5. DragonZX

    DragonZX New Member

    What version, would you recommend? As I thought, it worked correctly with 7.4, however, I have the same error now. Also, I have changed the 7.4 setting in the FastCGI option, how can I turn it back without admin panel access?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The version that belongs to the OS version you installed. These are the default versions that should be used:

    Debian 9: PHP 7.0
    Debian 10: PHP 7.3
    Debian 11: PHP 7.4
    Ubuntu 16.04: PHP 7.0
    Ubuntu 18.04: PHP 7.2
    Ubuntu 20.04: PHP 7.4
    CentOS 7: PHP 5.4
    CentOS 8: PHP 7.2

    You can't, you must repair the PHP installation first.
     
  7. DragonZX

    DragonZX New Member

    Now I have such a log, but I am still seeing the same issue.
    after changing the main PHP to 7.4
    Code:
    update-alternatives --config php
    update-alternatives --config phar
    update-alternatives --config phar.phar
    
    I was able to reconfigure the panel, but still get the error

    Code:
    [Sat Dec 11 13:46:09.263443 2021] [mpm_prefork:notice] [pid 1418] AH00163: Apache/2.4.51 (Debian) mod_fcgid/2.3.9 Phusion_Passenger/5.0.30 OpenSSL/1.1.1k configured -- resuming normal operations
    [Sat Dec 11 13:46:09.263462 2021] [core:notice] [pid 1418] AH00094: Command line: '/usr/sbin/apache2'
    [Sat Dec 11 13:46:32.114479 2021] [fcgid:warn] [pid 1451] [client 127.0.0.1:21835] mod_fcgid: stderr: PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366) : eval()'d code:116
    [Sat Dec 11 13:46:32.114501 2021] [fcgid:warn] [pid 1451] [client 127.0.0.1:21835] mod_fcgid: stderr: Stack trace:
    [Sat Dec 11 13:46:32.114504 2021] [fcgid:warn] [pid 1451] [client 127.0.0.1:21835] mod_fcgid: stderr: #0 /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366): eval()
    [Sat Dec 11 13:46:32.114507 2021] [fcgid:warn] [pid 1451] [client 127.0.0.1:21835] mod_fcgid: stderr: #1 /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(769): tpl->_parse()
    [Sat Dec 11 13:46:32.114509 2021] [fcgid:warn] [pid 1451] [client 127.0.0.1:21835] mod_fcgid: stderr: #2 /usr/local/ispconfig/interface/web/index.php(117): tpl->pparse()
    [Sat Dec 11 13:46:32.114511 2021] [fcgid:warn] [pid 1451] [client 127.0.0.1:21835] mod_fcgid: stderr: #3 {main}
    [Sat Dec 11 13:46:32.114514 2021] [fcgid:warn] [pid 1451] [client 127.0.0.1:21835] mod_fcgid: stderr:   thrown in /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366) : eval()'d code on line 116
    [Sat Dec 11 13:46:33.331863 2021] [fcgid:warn] [pid 1452] [client 127.0.0.1:21837] mod_fcgid: stderr: PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366) : eval()'d code:116
    [Sat Dec 11 13:46:33.331886 2021] [fcgid:warn] [pid 1452] [client 127.0.0.1:21837] mod_fcgid: stderr: Stack trace:
    [Sat Dec 11 13:46:33.331894 2021] [fcgid:warn] [pid 1452] [client 127.0.0.1:21837] mod_fcgid: stderr: #0 /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366): eval()
    [Sat Dec 11 13:46:33.331896 2021] [fcgid:warn] [pid 1452] [client 127.0.0.1:21837] mod_fcgid: stderr: #1 /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(769): tpl->_parse()
    [Sat Dec 11 13:46:33.331898 2021] [fcgid:warn] [pid 1452] [client 127.0.0.1:21837] mod_fcgid: stderr: #2 /usr/local/ispconfig/interface/web/index.php(117): tpl->pparse()
    [Sat Dec 11 13:46:33.331901 2021] [fcgid:warn] [pid 1452] [client 127.0.0.1:21837] mod_fcgid: stderr: #3 {main}
    [Sat Dec 11 13:46:33.331903 2021] [fcgid:warn] [pid 1452] [client 127.0.0.1:21837] mod_fcgid: stderr:   thrown in /usr/local/ispconfig/interface/lib/classes/tpl.inc.php(1366) : eval()'d code on line 116
    
     

    Attached Files:

    • php.txt
      File size:
      19.1 KB
      Views:
      10
    Last edited: Dec 11, 2021
  8. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  9. DragonZX

    DragonZX New Member

    Thanks, that is the one I was looking for:)
     

Share This Page