PHP error during ISPConfig install

Discussion in 'ISPConfig 3 Priority Support' started by Thomas Prüfer, Dec 28, 2016.

  1. Thomas Prüfer

    Thomas Prüfer New Member

    Hello,

    rigth in the beginning after starting the process with php -q install.php i get the following error:

    PHP Warning: Illegal string offset 'global' in /tmp/ispconfig3_install/install/lib/install.lib.php on line 631
    PHP Fatal error: Uncaught Error: Cannot use string offset as an array in /tmp/ispconfig3_install/install/lib/install.lib.php:631
    Stack trace:
    #0 /tmp/ispconfig3_install/install/lib/installer_base.lib.php(292): ini_to_array('[global]\nwebser...')
    #1 /tmp/ispconfig3_install/install/install.php(314): installer_base->add_database_server_record()
    #2 {main}
    thrown in /tmp/ispconfig3_install/install/lib/install.lib.php on line 631

    Ubuntu 16.04
    php7
    followed the installation manuell of "The Perfect Server - Ubuntu 16.04 (Xenial Xerus) with Apache, PHP, MySQL, PureFTPD, BIND, Postfix, Dovecot and ISPConfig 3.1"
    Please help
    Thank you!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The php 7 is the official version from Ubuntu not a third party PHP?

    Please run thes e commands to see if it works then:

    Code:
    rm -rf /tmp/ispconfig3_install
    cd /tmp
    wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
    tar xfz ISPConfig-3-stable.tar.gz
    cd ispconfig3_install/install/
    php install.php
     
  3. Thomas Prüfer

    Thomas Prüfer New Member

    Why should it work? It is the same i did several times. :)
    I also removed the 7.1 version and used the "standart" ubuntu 7.0 version with same result. This is the second server installation I have the same problem with. Doesn't matter if 7.0 or 7.1
    Anyway here the output from deleting, redownloading and installing again:
    PHP Warning: Illegal string offset 'global' in /tmp/ispconfig3_install/install/lib/install.lib.php on line 631
    PHP Fatal error: Uncaught Error: Cannot use string offset as an array in /tmp/ispconfig3_install/install/lib/install.lib.php:631
    Stack trace:
    #0 /tmp/ispconfig3_install/install/lib/installer_base.lib.php(292): ini_to_array('[global]\nwebser...')
    #1 /tmp/ispconfig3_install/install/install.php(314): installer_base->add_database_server_record()
    #2 {main}
    thrown in /tmp/ispconfig3_install/install/lib/install.lib.php on line 631
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    When you followed the tutorial then you downloaded a different ispconfig version from our GIT server than the version that I told you to download above. You understand that a different software version can make a difference?

    And you followed the tutorial to the letter, no changes? And it is a fresh installation?
     
  5. Thomas Prüfer

    Thomas Prüfer New Member

    I know that from pgp 7.0 is something with array and string. there need to be done changes in the script because it come here to an forbidden situation when this comes up :
    PHP Fatal error: Uncaught Error: Cannot use string offset as an array in
    This needs to be changed in old scripts which used php5.6 and so on when you go to php7.0 or 7.X
    I had the same situation with several other applications like a webshop as example, they did changes like from this:

    Code:
       function get_config_bytes($val) {
            $val = trim($val);
            $last = strtolower($val[strlen($val)-1]);
            switch($last) {
                case 'g':
                    $val *= 1024;
                case 'm':
                    $val *= 1024;
                case 'k':
                    $val *= 1024;
            }
            return $this->fix_integer_overflow($val);

    to this:
    Code:
            function get_config_bytes($val) {
            $val = trim($val);
            $last = strtolower($val[strlen($val)-1]);
            switch($last) {
                case 'g':
                    $val = substr($val, 0, strlen($val)-1) * 1024;
                case 'm':
                    $val = substr($val, 0, strlen($val)-1) * 1024;
                case 'k':
                    $val = substr($val, 0, strlen($val)-1) * 1024;
            }
            return $this->fix_integer_overflow($val);
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The version that I told you to download is fully php 7 compatible, there are many thousand ISPConfig systems running on PHP 7 already incl. the test server where I just run the installer on Ubuntu 16.04 without issues. So it is really unlikely that there are any changes in the code required when it works on all other php 7 servers. Please answer my questions from above if I shall be able to help you.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    I found an issue with variable casting, you can download the new version like this:

    wget -O ispconfig.tar.gz https://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=stable-3.1

    I just wonder why it works on my server which is the exact copy of the guide that you said that you used. My guess is that you either changed php settings e.g. enforced strict checking or that you used a different PHP version (e.g. php 7.1 that is not supported by ISPConfig yet) than the one that is used in the tutorial.
     
  8. Thomas Prüfer

    Thomas Prüfer New Member

    I did not killed the hole server, of course not since there are sevices already running and some gb of data!
    I purged apache, purged php, mysql, postfix and spamass, procmail and many more even proftp. What I didn't removed was fail2ban, modsecurity incl. csr and owasp, clamav.
    Than I followed the instructions all with option overwrite and used php7.1 which came from launchpad (ondrej).
    May you need to know that I paid for both, the manual and for ISPConfig. I could imagine this fact makes it easier that I don't deleted the hole host.
    If I start a new installation LAMP or LEMP would be anyway installed by default.

    I told you about the code change because I had this situation TODAY on a different server running opencart and 7.1. And the only thing they needed to do was those changes. I am not a developer, thats the only thing I could see out of the message. And if I would understand what I need to change to get it running on 7.1 I would do those changes because if I install a system I don't use versions which will become old very fast. So how can you help me, what shell I do?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    An ISPConfig install should be done on an empty system for the start. Installing it on a server that hosts already sites might damage the system config or ispconfig might not work as it is unlikely that your current setup is compatiböe with the one that ISPConfig requires.

    You paid for ISPConfig? ISPConfig can not be bought, it is OpenSource software and we do not sell it. Only the manual is available for sale.

    You said you used:

    so you said that you are using php 7 and not 7.1. PHP 7 and 7.1 are different PHP versions and software that is compatible with php 7 (like ISPConfig) does not nescessarily runs on PHP 7.1. If you would have said right away that you used PHP 7.1 and not PHP 7 then I could have told you in the first post that you have to remove it from your server and install the system exactly as described in the perfect server tutorial.

    ISPConfig has not be tested with PHP 7.1 yet as ISPConfig always requires the PHP version that ships with a specific OS and PHP 7.1 is not delivered with any supported OS yet. You can use PHP 7.1 as additional PHP version in ISPConfig though. and btw, the LTS updates from Ubuntu get delivered for PHP 7 that ships with Ubuntu, not the one from Ondrej, so to keep a longtime updated OS, don't use third party PHP versions as main PHP.

    So what to do next: Replace the PHp 7.1 packages with the right ones from Ubuntu and install ISPConfig.
     
  10. Thomas Prüfer

    Thomas Prüfer New Member

    I just give up! Even if the installer went now through, the hole apache config is not working.
    About paying for ispconfig you are right, it was virtualmin I paid for.
    I thought I could try something new and fancy, but unfortunately...
    May I try again if there is a manual installation available where I can also see what is going on during the install. Feels also more comfortable if you do it handy, it is all about to have full control.
    Thanks for your help!
    Einen schönen Abend noch und guten Rutsch ins neue Jahr!
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    To get a working server, start with a Minimal Ubuntu or Debian System. All hosters provide such minimal servers. If you realy have no minimal system, then start with a clean LAMP server. You can not use diferent ControlPanels together, so if you e.g. have virtualmin, Plesk or a similar panel installed, then you can not install ISPConfig on that server without a Clean reinstall, the same applies for other panels as well btw. Then follow the perfect server guide to the letter and do not replace any packages with ones that do not work with ispconfig, as I mentioned above, you can not use PHP 7.1 yet, so do not replace the system PHP packages with other ones. ISPConfig prvides a very detailed log from installation and has also a debug mode for operation which shows each single command that get's executed and the errors that occur during execution, see log files in /var/log/ispconfig/
     
  12. budgierless

    budgierless Member HowtoForge Supporter

    PLEASE HELP!!
    I am having almost the same issue, I trying to setup a new production server.
    Ubuntu 16.04, MySQL 5.7.19(Not mariadb) php7.0(Ubuntu repo version)
    the problem is at the ispconfig install stage, when the installer wants to add to the database but cant because of the error:
    Code:
    Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION. Add
      sql-mode="NO_ENGINE_SUBSTITUTION"
    so after adding:
    Code:
    [mysqld]
    sql-mode=NO_ENGINE_SUBSTITUTION  
    to the mysql.cnf file then re-running installer after then MySQL restart I then get this error:
    Code:
    PHP Fatal error:  Uncaught Error: Call to a member function queryAllRecords() on null in /tmp/ispconfig3-stable-3.1-b1337668df50d3672b348708a4a3949b2fca1f60/install/lib/installer_base.lib.php:238
    Stack trace:
    #0 /tmp/ispconfig3-stable-3.1-b1337668df50d3672b348708a4a3949b2fca1f60/install/install.php(294): installer_base->configure_database()
    #1 {main}
      thrown in /tmp/ispconfig3-stable-3.1-b1337668df50d3672b348708a4a3949b2fca1f60/install/lib/installer_base.lib.php on line 238
    
    please advise
     
    Michel Figueira likes this.
  13. florian030

    florian030 Well-Known Member HowtoForge Supporter

Share This Page