Update to 3.1.14 has PHP>=5.4 code

Discussion in 'Installation/Configuration' started by TechNyquist, Jul 9, 2019.

  1. TechNyquist

    TechNyquist New Member

    Hello everyone,
    I see forum is pretty hot at the moment as update was released so I'll post a simple one to let me understand.
    I'm on CentOS 6 and using succesfully your great software.
    Now, last two updates failed because of a PHP syntax error right after the question "Create new ISPConfig SSL certificate (yes,no) [no]:", and the error is the following:

    PHP Parse error: syntax error, unexpected '[' in /usr/local/ispconfig/server/plugins-available/powerdns_plugin.inc.php on line 535
    I checked out that line and found that there two arrays are declared with "$somename = [];" that is array syntax sugar available from PHP 5.4 . I'm using PHP 5.3.3 so it failed both updates to 3.1.14 and to 3.1.14p1 .

    Now my question is: was the minimum required PHP version for ISPConfig raised (thus I'm outdated) or is this a bug (thus it needs a fix) ?
    Thank you.
     
  2. Jesse Norell

    Jesse Norell Well-Known Member

    I suspect it's a regression, not that minimum requirements changed. If you change the initializations from '[]' to 'array()' does the update continue without further issues?
     
  3. TechNyquist

    TechNyquist New Member

    Hi Jesse, thank you for reply
    I tried that launching again the "ispconfig_update.sh" after the edit, but the script now says that there are no more updates and quits. If you know of a way to "force" the update I'll let you know in minutes.
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Download the ISPConfig installer package. and run the update script from there. That forces the update to run.
     
  5. budgierless

    budgierless Member HowtoForge Supporter

    Wrong dude, the system requirements have changed, for example: ubuntu 8.04-18.04 for ispconfig 3.1.13p1 but only ubuntu 16.04-18.04 for ispconfig 3.1.14+
     
    Jesse Norell likes this.
  6. TechNyquist

    TechNyquist New Member

    Ok, it took me a bit more than expected because those two instructions were not enough.
    Follows the complete list of editings required to make the update PHP 5.3 compliant.
    All the edits are from file: ispconfig/server/plugins-available/powerdns_plugin.inc.php
    • Line 535:
      $pubkeys = [];
      became
      $pubkeys = array();
    • Line 552:
      $formatted = [];
      became
      $formatted = array();
    • Line 542:
      $dnssec_info = array_merge($this->format_dnssec_pubkeys($pubkeys), ['', '== Raw log ============================'], $log);
      became
      $dnssec_info = array_merge($this->format_dnssec_pubkeys($pubkeys), array('', '== Raw log ============================'), $log);
    • Line 573:
      if (!in_array($key_type, ['KSK', 'CSK'], true)) {
      became
      if (!in_array($key_type, array('KSK', 'CSK'), true)) {
    • Line 676:
      $dnssec_info = array_merge(['== Raw log ============================'], $log);
      became
      $dnssec_info = array_merge(array('== Raw log ============================'), $log);
    This way I reached the final "Update finished." .
     
  7. budgierless

    budgierless Member HowtoForge Supporter

    Like i said php support for 3.1.14 is now only limited cover form the last 2-3 years, i your php is too old, you can only use ispconfig upto 3.1.13p1 on your system.
     
  8. TechNyquist

    TechNyquist New Member

    Cross-posting: sorry, didn't read your post because you posted while I was completing my post.
    Ok, so the final answer is "I'm outdated". Alright, I'll update my system.

    Where can I track the PHP version that ISPConfig will need from now on?
     
  9. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    ISPConfig needs the PHP version that comes standard with the operating system that ISPConfig supports. If the OS is out of support, newer versions of ISPConfig may no longer support that old system with it's old PHP version.
     
  10. TechNyquist

    TechNyquist New Member

    Alright.
    Thank you and good job.
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    We will probably backport the code of that plugin to be compatible with older PHP releases, but just as it's not a big deal to do so and the only drawback is a bit longer code. As mentioned in the release notes, we started to abandon very old operating system versions as they limit us in development and php 5.3 is so old now that it's time to stop supporting it.
     
  12. TechNyquist

    TechNyquist New Member

    I plenty agree with you.
    Indeed I'll update my system as time as come to do it; PHP 5.3 is old now, and this just gives you a clue about how long is I'm using your great manager :) by the way, keep it up!
     
    till likes this.

Share This Page