ISPConfig won't start, gives PHP fatal error

Discussion in 'Installation/Configuration' started by ChaoticReality, Jan 4, 2012.

  1. ChaoticReality

    ChaoticReality New Member

    A few hours ago, I completed an install of the latest ISPConfig on Ubuntu 11.04 Server. Followed the Perfect Server guide and with the addition of an iptables rule to allow access on port 8080, everything seemed to be working fine.

    However, several hours later I found myself unable to connect to the admin interface. netstat -tap reveals that apache2 is no longer listening on port 8080 and the iptables rules appear to have vanished.

    /var/log/ispconfig/ispconfig.log is empty, but the cron.log is full of this message:

    PHP Fatal error:  Call to a member function connect() on a non-object in /usr/local/ispconfig/server/server.php on line 43

    If I try and start the server manually as root using the provided shell script, I get exactly the same error in my terminal. I had a look at the php script and it would appear to be an error that originates with something in not loading properly.

    I have tentatively ruled out non-loading of the include files as there's no error relating to that anywhere (and I would expect PHP to throw an error if a require_once file wasn't found.

    Running the update script (just in case) yielded this error:
    PHP Notice:  Undefined variable: conf in /tmp/ispconfig3_install/install/update.php on line 76
    Unable to resolve hostname
    and then dumped back into terminal.

    I am officially stumped, especially as everything was working fine before and then just suddenly stopped. I have rebooted the server and nothing has changed. Any suggestions?

    Thanks in advance!
  2. cbj4074

    cbj4074 Member

    What happens when you start Apache on the terminal?

    # service apache2 start
  3. ChaoticReality

    ChaoticReality New Member

    Thanks for your quick reply.

    Apache starts as normal with no visible error messages:

    [email protected]:/usr/local/ispconfig/server/lib# service apache2 start
     * Starting web server apache2                                                                                                                [ OK ] 
    [email protected]:/usr/local/ispconfig/server/lib# 
    Nothing new in /var/logs/apache2/error.log either.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Check the file /etc/hostname and ensure that it contains a line for your hostname. You can get the current hostname of your server by executing the command:


    2) Then run the ispconfig update again and choose to reconfigure services during update.
  5. ChaoticReality

    ChaoticReality New Member

    Hi Till,

    /etc/hostname contains the correct hostname for the server and matches the output of the hostname command.

    The update script and attempting to manually restart are still producing the same errors as in my previous post.

    Any other ideas?

  6. till

    till Super Moderator Staff Member ISPConfig Developer

    According to php, the hostname is unresolvable.

    Please post the exavt output of the command:

    hostname -f

    and the content of the file /etc/resolv.conf
  7. ChaoticReality

    ChaoticReality New Member

    Thanks for your help so far.

    [email protected]:~# hostname -f
    [email protected]:~# cat /etc/resolv.conf
    I'm still confused as to why the problem has developed now, after I had no problem setting up and running ISPConfig initially and nothing on the system has changed (as far as I know).
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Make a backup of the resolv.conf file and replace its whole content with these details:

    then try to do the ispconfig update again.
  9. ChaoticReality

    ChaoticReality New Member

    Still the same error. I have also just tried putting the hostname and correct IP into /etc/hosts and that also doesn't solve the issue.

    Incidentally, PHP can definitely resolve the hostname fine. I have just run this script in terminal and it returns the correct IP address:
    $ip = gethostbyname('');
    echo $ip;
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Have you disabled php functions like exec in your php.ini file? If thats the case, the ispconfig updater and other ispconfig functions will fail.
  11. ChaoticReality

    ChaoticReality New Member

    Nope, it was a brand new blank OS install. All I've done is follow the Perfect Server guide. Haven't touched anything else on the server except to add an iptables rule to allow access on 8080.

    As I said, it was working fine and then just suddenly stopped with no changes which is why I'm so baffled.

    It's this error that's the most confusing (when I try and start ISPConfig): PHP Fatal error: Call to a member function connect() on a non-object in /usr/local/ispconfig/server/server.php on line 43

    It appears that line 43 is referencing a function provided by the included files, which are obviously loading fine, since they aren't erroring on the require_once function.

    Is there anything I can do to provide more diagnostics or should I just try a complete reinstall of ISPConfig?
    Last edited: Jan 5, 2012
  12. cbj4074

    cbj4074 Member

    The error means that $app->dbmaster is not an object, which seems unusual.

     * Try to Load the server configuration from the master-db
    if ($app->dbmaster->connect()) {
    If we follow the trail, we find the following in server/lib/app.php, line 44:

    Initialize the connection to the master DB, 
    if we are in a multiserver setup
    if($conf['dbmaster_host'] != '' && $conf['dbmaster_host'] != $conf['db_host']) {
    	$this->dbmaster = new db;
    } else {
    	$this->dbmaster = $this->db;
    So, it appears to be a configuration problem relative to your database. Why the parser is descending into the "multiserver setup" block is beyond me... unless, of course, you elected to configure for multiserver during install.

    That said, you shouldn't have to be debugging PHP code to get ISPConfig up-and-running. Either there's a bug in the code or your DB setup is fundamentally flawed.

    I could be wrong ;)
  13. ChaoticReality

    ChaoticReality New Member

    Thanks for your analysis. I did wonder when looking at the code if it could be a database problem. mysqld shows no failed logins which is what I suspected the most likely problem would be.

    I didn't choose multi-server as far as I know and I'm not sure how my DB setup could get so messed up already, since it was installed/setup as part of the ISPConfig installation.

    I'm about to wipe all the packages just down to the base os and try installing via the Perfect Server guide again. Thanks for all your help, i'll let you know if the problem reproduces.

Share This Page