dave_85

Topic: Uncaught exception / class.Db errors

Morning / Evening,

I am installing jobberbase on a subdomain of my site -> jobs.socialmedianews.com.au

My host has the necessary requirements for a jobberBase install and i have followed the installation instructions as per this link: http://wiki.jobberbase.com/install/guide-for-apache

I have only been editing/tweaking config.envs.php and this is how the file looks:

Code:

<?php
/**
 * Define environments
 *
 */

// local (http://localhost/jobberbase/public)
$__instances['local'] = array(
    // should be a unique part of the url (or the entire url if you wish)
    'prefix' => 'jobs.socialmedianews.com.au',
    // mysql credentials
    'db_host' => 'localhost',
    'db_port' => 3306,
    'db_user' => 'secret',
    'db_password' => 'secret',
    'db_name' => 'secret',
    'db_prefix' => '',
    // your site's full url
    'app_url' => 'http://localhost/jobs/',
    // error reporting
    'ini_error_reporting' => E_ALL,
    'ini_display_errors' => 'On',
    // environment setting 1 (use 'local' for localhost/testing OR 'online' for live, production environment)
    'location' => 'local',
    // environment setting 2 (use 'dev' together with 'local' in the previous setting OR 'prod' with 'online')
    'environment' => 'dev',
    //'apache_mod_rewrite', 'iis_url_rewrite' -microsoft URL Rewrite module, 'iis_isapi_rewrite'
    'rewrite_mode' => 'apache_mod_rewrite'
);

// live (http://jobs.socialmedianews.com.au)
$__instances['live'] = array(
    'prefix' => '173.230.148.113',
    'db_host' => 'localhost',
    'db_port' => 3306,
    'db_user' => 'secret',
    'db_password' => 'secret',
    'db_name' => 'secret',
    'db_prefix' => '',
    'app_url' => '173.230.148.113',
    'ini_error_reporting' => E_ALL,
    'ini_display_errors' => 'Off',
    'location' => 'online',
    'environment' => 'prod',
    'rewrite_mode' => 'apache_mod_rewrite'
);


// setup current instance
foreach ($__instances as $__instance)
{
    // http requests
    if (isset($_SERVER['HTTP_HOST']))
    {
        $_compare_to = $_SERVER['HTTP_HOST'];
    }

    if (strstr($_compare_to, $__instance['prefix']))
    {
        define('DB_HOST', $__instance['db_host']);
        define('DB_PORT', $__instance['db_port']);
        define('DB_USER', $__instance['db_user']);
        define('DB_PASS', $__instance['db_password']);
        define('DB_NAME', $__instance['db_name']);
        define('DB_PREFIX', $__instance['db_prefix']);

        // values kind of redundant, they indicate wether this is a live/production or dev/testing environment
        define('LOCATION', $__instance['location']);
        define('ENVIRONMENT', $__instance['environment']);
        
        // base url of the app
        define('APP_URL', $__instance['app_url']);
        define('REWRITE_MODE', $__instance['rewrite_mode']);
        // error reporting
        ini_set('error_reporting', $__instance['ini_error_reporting']);
        ini_set('display_errors', $__instance['ini_display_errors']);
        
        break;
    }
}
?>

the error i am getting is:

Fatal error: Uncaught exception 'QueryException' with message 'Table 'socialme_jobberbase.settings' doesn't exist' in /home/socialme/public_html/jobs/_includes/class.Db.php:34 Stack trace: #0 /home/socialme/public_html/jobs/_includes/class.JobberSettings.php(19): Db->query('SELECT * FROM s...') #1 /home/socialme/public_html/jobs/_config/config.php(75): JobberSettings->__construct() #2 /home/socialme/public_html/jobs/index.php(16): require_once('/home/socialme/...') #3 {main} thrown in /home/socialme/public_html/jobs/_includes/class.Db.php on line 34

Can anyone offer any advice?

Thank you in advance.

cheers
David

testgigs

Re: Uncaught exception / class.Db errors

I'd start by checking that the settings table in the DB has been created

www.gigajobs.com.au / Aussie IT Jobs

dave_85

Re: Uncaught exception / class.Db errors

hi, there should be 13 tables in total?
they have all be created.

(im new to mysql)

thanks,

Last edited by dave_85 (2010-08-10 03:56:43)

dave_85

Re: Uncaught exception / class.Db errors

ok i have changed

$__instances['local'] = array(

to

$__instances['live'] = array(

and now get this error

Warning: mysqli::mysqli() expects parameter 5 to be long, string given in /home/socialme/public_html/jobs/_includes/class.Db.php on line 20

Warning: mysqli::query() [mysqli.query]: Couldn't fetch Db in /home/socialme/public_html/jobs/_includes/class.Db.php on line 72

Warning: mysqli_error() [function.mysqli-error]: Couldn't fetch Db in /home/socialme/public_html/jobs/_includes/class.Db.php on line 73

Warning: mysqli::query() [mysqli.query]: Couldn't fetch Db in /home/socialme/public_html/jobs/_includes/class.Db.php on line 31

Warning: mysqli_error() [function.mysqli-error]: Couldn't fetch Db in /home/socialme/public_html/jobs/_includes/class.Db.php on line 32

Fatal error: Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23

any ideas?
ty

putypuruty

Re: Uncaught exception / class.Db errors

Hi,

In the $__instances['live'] part in config.envs.php, do the following:

- set the prefix to socialmedianews.com.au
- set the app_url to http://jobs.socialmedianews.com.au/

I think this should fix your problem.

dave_85

Re: Uncaught exception / class.Db errors

Hi, thanks for your reply.

i have updated config.envs.php to

Code:

<?php
/**
 * Define environments
 *
 */

// local (http://localhost/jobberbase/public)
$__instances['live'] = array(
    // should be a unique part of the url (or the entire url if you wish)
    'prefix' => 'socialmedianews.com.au',
    // mysql credentials
    'db_host' => 'localhost',
    'db_port' => 3306,
    'db_user' => 'XXX',
    'db_password' => 'XXX',
    'db_name' => 'XXX',
    'db_prefix' => '',
    // your site's full url
    'app_url' => 'http://jobs.socialmedianews.com.au/',
    // error reporting
    'ini_error_reporting' => E_ALL,
    'ini_display_errors' => 'On',
    // environment setting 1 (use 'local' for localhost/testing OR 'online' for live, production environment)
    'location' => 'local',
    // environment setting 2 (use 'dev' together with 'local' in the previous setting OR 'prod' with 'online')
    'environment' => 'dev',
    //'apache_mod_rewrite', 'iis_url_rewrite' -microsoft URL Rewrite module, 'iis_isapi_rewrite'
    'rewrite_mode' => 'apache_mod_rewrite'
);

// live (http://jobs.socialmedianews.com.au)
$__instances['live'] = array(
    'prefix' => 'socialmedianews.com.au',
    'db_host' => 'localhost',
    'db_port' => 3306,
    'db_user' => 'XXX',
    'db_password' => 'XXX',
    'db_name' => 'XXX',
    'db_prefix' => '',
    'app_url' => 'http://jobs.socialmedianews.com.au/',
    'ini_error_reporting' => E_ALL,
    'ini_display_errors' => 'Off',
    'location' => 'online',
    'environment' => 'prod',
    'rewrite_mode' => 'apache_mod_rewrite'
);


// setup current instance
foreach ($__instances as $__instance)
{
    // http requests
    if (isset($_SERVER['HTTP_HOST']))
    {
        $_compare_to = $_SERVER['HTTP_HOST'];
    }

    if (strstr($_compare_to, $__instance['prefix']))
    {
        define('DB_HOST', $__instance['db_host']);
        define('DB_PORT', $__instance['db_port']);
        define('DB_USER', $__instance['db_user']);
        define('DB_PASS', $__instance['db_password']);
        define('DB_NAME', $__instance['db_name']);
        define('DB_PREFIX', $__instance['db_prefix']);

        // values kind of redundant, they indicate wether this is a live/production or dev/testing environment
        define('LOCATION', $__instance['location']);
        define('ENVIRONMENT', $__instance['environment']);
        
        // base url of the app
        define('APP_URL', $__instance['app_url']);
        define('REWRITE_MODE', $__instance['rewrite_mode']);
        // error reporting
        ini_set('error_reporting', $__instance['ini_error_reporting']);
        ini_set('display_errors', $__instance['ini_display_errors']);
        
        break;
    }
}
?>

and i just got a blank page.

i read this thread: http://www.jobberbase.com/forum/topic26 … -help.html

so i updated my root htaccess file to

Code:

# AddType x-mapp-php5 .php
# AddHandler x-mapp-php5 .php

RewriteEngine on
#Options +FollowSymlinks

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
RewriteBase /Jobs

ErrorDocument 404 /page-unavailable/

<files ~ "\.tpl$">
order deny,allow
allow from none
deny from all
</files>

and the admin htaccess file to

Code:

RewriteEngine on
Options +FollowSymlinks

RewriteBase /jobs/admin

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
RewriteBase /Jobs/admin

ErrorDocument 404 /page-unavailable/

still got a blank page.

the error log for today is showing this:

[12-Aug-2010 08:14:44] PHP Warning:  mysqli::mysqli() expects parameter 5 to be long, string given in /home/socialme/public_html/jobs/_includes/class.Db.php on line 20
[12-Aug-2010 08:14:44] PHP Warning:  mysqli::query() [<a href='mysqli.query'>mysqli.query</a>]: Couldn't fetch Db in /home/socialme/public_html/jobs/_includes/class.Db.php on line 72
[12-Aug-2010 08:14:44] PHP Warning:  mysqli_error() [<a href='function.mysqli-error'>function.mysqli-error</a>]: Couldn't fetch Db in /home/socialme/public_html/jobs/_includes/class.Db.php on line 73
[12-Aug-2010 08:14:44] PHP Warning:  mysqli::query() [<a href='mysqli.query'>mysqli.query</a>]: Couldn't fetch Db in /home/socialme/public_html/jobs/_includes/class.Db.php on line 31
[12-Aug-2010 08:14:44] PHP Warning:  mysqli_error() [<a href='function.mysqli-error'>function.mysqli-error</a>]: Couldn't fetch Db in /home/socialme/public_html/jobs/_includes/class.Db.php on line 32
[12-Aug-2010 08:14:44] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:14:45] PHP Warning:  mysqli::mysqli() expects parameter 5 to be long, string given in /home/socialme/public_html/jobs/_includes/class.Db.php on line 20
[12-Aug-2010 08:14:45] PHP Warning:  mysqli::query() [<a href='mysqli.query'>mysqli.query</a>]: Couldn't fetch Db in /home/socialme/public_html/jobs/_includes/class.Db.php on line 72
[12-Aug-2010 08:14:45] PHP Warning:  mysqli_error() [<a href='function.mysqli-error'>function.mysqli-error</a>]: Couldn't fetch Db in /home/socialme/public_html/jobs/_includes/class.Db.php on line 73
[12-Aug-2010 08:14:45] PHP Warning:  mysqli::query() [<a href='mysqli.query'>mysqli.query</a>]: Couldn't fetch Db in /home/socialme/public_html/jobs/_includes/class.Db.php on line 31
[12-Aug-2010 08:14:45] PHP Warning:  mysqli_error() [<a href='function.mysqli-error'>function.mysqli-error</a>]: Couldn't fetch Db in /home/socialme/public_html/jobs/_includes/class.Db.php on line 32
[12-Aug-2010 08:14:45] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:15:42] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:15:43] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:15:47] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:15:47] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:16:53] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:16:53] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:18:05] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:18:06] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:20:55] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:20:55] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:21:44] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:21:45] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:24:30] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:24:31] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:24:33] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:24:34] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:25:32] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:25:32] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:25:53] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:25:54] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:25:58] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:25:58] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:27:06] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:27:07] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:29:06] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:29:07] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:30:56] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23
[12-Aug-2010 08:30:57] PHP Fatal error:  Call to a member function fetch_assoc() on a non-object in /home/socialme/public_html/jobs/_includes/class.JobberSettings.php on line 23

please remember i am trying to get this to work on sub domain http://jobs.socialmedianews.com.au/

Any ideas?
ty

putypuruty

Re: Uncaught exception / class.Db errors

I see that the site is working so I assume that you managed to fix the problem.

dave_85

Re: Uncaught exception / class.Db errors

hello,

no i installed alternative software for the time being

do you know how i can remedy the above errors?

thanks
david

putypuruty

Re: Uncaught exception / class.Db errors

Without having access to the code, it's pretty hard to fix the problem. If you think you can give me temporary FTP access to your site, just write me a mail from my profile page (http://www.jobberbase.com/forum/email19.html)