Welcome Guest, Not a member yet? Register   Sign In
An uncaught Exception was encountered
#1

My employer is closing down an existing webserver where we're running a few websites based on CodeIgniter 3.0.6. I recently backed up one of the sites and migrated it to a new web host, but am having difficulty getting the site running. I changed the server settings to use the /public directory as the home for the site, but it was not finding the application and system directories, so the hosting support said to change those variables to the full path. We did that, and now I'm getting an error message. I have no idea how to address this.

I found the /application/config/production directory and updated the config.php and database.php to match the new database's settings.

An uncaught Exception was encountered
Type: Error

Message: Call to undefined function mysql_connect()

Filename: /home/impact_nswtl1/nswtl.impactpreview.com/system/database/drivers/mysql/mysql_driver.php

Line Number: 136

Backtrace:

File: /home/impact_nswtl1/nswtl.impactpreview.com/application/controllers/Home.php
Line: 6
Function: __construct

File: /home/impact_nswtl1/nswtl.impactpreview.com/public/index.php
Line: 321
Function: require_once


***
here's line 136 in  /home/impact_nswtl1/nswtl.impactpreview.com/system/database/drivers/mysql/mysql_driver.php

: mysql_connect($this->hostname, $this->username, $this->password, TRUE, $client_flags);
Reply
#2

Just switch the driver to mysqli
Reply
#3

thanks, which config file do I use to set it to mysqli?
If you don't have strong moral convictions, you're likely to end up with plain old convictions.
Reply
Reply
#5

(04-13-2018, 01:19 AM)ciadmin Wrote: See https://www.codeigniter.com/user_guide/d...ation.html

Thanks, that helped a lot. I'm getting different errors now, but the website does load.

1) Where can I find the settings for which database is the default? Our previous dev team ran 1 setup with Dev, Prod, and Test, but I don't know how to switch the default from Dev to Prod.

2) Many of the links on the site point back to the old domain/host and not to the new URL. I checked the MySQL database, and there do not appear to be any hyperlinks in the database, so I'm still searching for where they are so that I can update them.


3) Our logins are not working, but that may be related to links going back to the old URL / the old database.

4) At the bottom of the page, there's a bunch of code showing up unexpectedly.

***
ENCHMARKS  
Loading Time: Base Classes  
0.0129
Controller Execution Time ( Home / Index )  
0.3161
Total Execution Time  
0.3292

  GET DATA  
No GET data exists
  MEMORY USAGE  
1,002,312 bytes
  POST DATA  
No POST data exists
  URI STRING  
No URI data exists
  CLASS/METHOD  
home/index
  DATABASE:  NSWTL_DEV (HOME:$DB)   QUERIES: 19 (0.2778 SECONDS)  (HIDE)
0.0003  
Code:
SELECT GET_LOCK('163930159f230191a85c2613d1a1bac9', 300) AS ci_session_lock 

0.1982  

Code:
SELECT `data`
FROM `ci_sessions`
WHERE `id` = '163930159f230191a85c2613d1a1bac9' 

0.0008  

Code:
SELECT *
FROM `clubs`
ORDER BY `name` 

0.0003  

Code:
SELECT *
FROM `series` 

0.0064  

Code:
SELECT club_id, SUM(set_total) as total FROM (

                        SELECT 
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 1 
                        AND 
                            m.away_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    UNION ALL 

                        SELECT   
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 1 
                        AND 
                            m.home_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    ) AS T 
                    GROUP BY club_id 
                    ORDER BY total DESC 

0.0097  

Code:
SELECT club_id, SUM(set_total) as total FROM (

                        SELECT 
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 2 
                        AND 
                            m.away_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    UNION ALL 

                        SELECT   
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 2 
                        AND 
                            m.home_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    ) AS T 
                    GROUP BY club_id 
                    ORDER BY total DESC 

0.0047  

Code:
SELECT club_id, SUM(set_total) as total FROM (

                        SELECT 
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 3 
                        AND 
                            m.away_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    UNION ALL 

                        SELECT   
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 3 
                        AND 
                            m.home_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    ) AS T 
                    GROUP BY club_id 
                    ORDER BY total DESC 

0.0042  

Code:
SELECT club_id, SUM(set_total) as total FROM (

                        SELECT 
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 4 
                        AND 
                            m.away_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    UNION ALL 

                        SELECT   
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 4 
                        AND 
                            m.home_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    ) AS T 
                    GROUP BY club_id 
                    ORDER BY total DESC 

0.0052  

Code:
SELECT club_id, SUM(set_total) as total FROM (

                        SELECT 
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 5 
                        AND 
                            m.away_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    UNION ALL 

                        SELECT   
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 5 
                        AND 
                            m.home_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    ) AS T 
                    GROUP BY club_id 
                    ORDER BY total DESC 

0.0049  

Code:
SELECT club_id, SUM(set_total) as total FROM (

                        SELECT 
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 6 
                        AND 
                            m.away_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    UNION ALL 

                        SELECT   
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 6 
                        AND 
                            m.home_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    ) AS T 
                    GROUP BY club_id 
                    ORDER BY total DESC 

0.0063  

Code:
SELECT club_id, SUM(set_total) as total FROM (

                        SELECT 
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 7 
                        AND 
                            m.away_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    UNION ALL 

                        SELECT   
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 7 
                        AND 
                            m.home_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    ) AS T 
                    GROUP BY club_id 
                    ORDER BY total DESC 

0.0093  

Code:
SELECT club_id, SUM(set_total) as total FROM (

                        SELECT 
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 8 
                        AND 
                            m.away_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    UNION ALL 

                        SELECT   
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 8 
                        AND 
                            m.home_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    ) AS T 
                    GROUP BY club_id 
                    ORDER BY total DESC 

0.0103  

Code:
SELECT club_id, SUM(set_total) as total FROM (

                        SELECT 
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 9 
                        AND 
                            m.away_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    UNION ALL 

                        SELECT   
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 9 
                        AND 
                            m.home_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    ) AS T 
                    GROUP BY club_id 
                    ORDER BY total DESC 

0.0047  

Code:
SELECT club_id, SUM(set_total) as total FROM (

                        SELECT 
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 10 
                        AND 
                            m.away_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    UNION ALL 

                        SELECT   
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 10 
                        AND 
                            m.home_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    ) AS T 
                    GROUP BY club_id 
                    ORDER BY total DESC 

0.0048  

Code:
SELECT club_id, SUM(set_total) as total FROM (

                        SELECT 
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 11 
                        AND 
                            m.away_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    UNION ALL 

                        SELECT   
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 11 
                        AND 
                            m.home_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    ) AS T 
                    GROUP BY club_id 
                    ORDER BY total DESC 

0.0048  

Code:
SELECT club_id, SUM(set_total) as total FROM (

                        SELECT 
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 12 
                        AND 
                            m.away_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    UNION ALL 

                        SELECT   
                            c.club_id,
                            c.set_total 
                        FROM 
                            courts as c,
                            matches as m 
                        WHERE 
                            m.series_id = 12 
                        AND 
                            m.home_club_id  = c.club_id
                        AND 
                            m.match_id = c.match_id 

                    ) AS T 
                    GROUP BY club_id 
                    ORDER BY total DESC 

0.0013  

Code:
SELECT *
FROM `matches`
WHERE `winner` IS NOT NULL 

0.0011  

Code:
SELECT *
FROM `message`
WHERE `message_id` = 1
 LIMIT 1 

0.0004  

Code:
SELECT *
FROM `photos`
ORDER BY `order` 

  HTTP HEADERS  (HIDE)
HTTP_ACCEPT  
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
HTTP_USER_AGENT  
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
HTTP_CONNECTION  
close
SERVER_PORT  
80
SERVER_NAME  
nswtl.impactpreview.com
REMOTE_ADDR  
208.185.184.74
SERVER_SOFTWARE  
Apache
HTTP_ACCEPT_LANGUAGE  
en-US,en;q=0.9
SCRIPT_NAME  
/index.php
REQUEST_METHOD  
GET
HTTP_HOST  

REMOTE_HOST  

CONTENT_TYPE  

SERVER_PROTOCOL  
HTTP/1.1
QUERY_STRING  

HTTP_ACCEPT_ENCODING  
gzip, deflate
HTTP_X_FORWARDED_FOR  

HTTP_DNT  

  SESSION DATA  (HIDE)
__ci_last_regenerate  
1523649663

  CONFIG VARIABLES  (HIDE)
base_url  
http://nswtl.impactpreview.com/
index_page  

uri_protocol  
REQUEST_URI
url_suffix  

language  
english
charset  
UTF-8
enable_hooks  

subclass_prefix  
MY_
composer_autoload  

permitted_uri_chars  
a-z 0-9~%.:_\-
allow_get_array  
1
enable_query_strings  

controller_trigger  
c
function_trigger  
m
directory_trigger  
d
log_threshold  
4
log_path  

log_file_extension  

log_file_permissions  
420
log_date_format  
Y-m-d H:iConfused
error_views_path  

cache_path  

cache_query_string  

encryption_key  
YRi5Uf5EY7AUfgc8j23fSrad2E3nY9i8
sess_driver  
database
sess_cookie_name  
ci_session
sess_expiration  
7200
sess_save_path  
ci_sessions
sess_match_ip  

sess_time_to_update  
300
sess_regenerate_destroy  

cookie_prefix  

cookie_domain  

cookie_path  
/
cookie_secure  

cookie_httponly  

standardize_newlines  

global_xss_filtering  

csrf_protection  
1
csrf_token_name  
csrf_test_name
csrf_cookie_name  
csrf_cookie_name
csrf_expire  
7200
csrf_regenerate  

csrf_exclude_uris  
Array ( [0] => misc/status )
compress_output  

time_reference  
local
rewrite_short_tags  

proxy_ips  
If you don't have strong moral convictions, you're likely to end up with plain old convictions.
Reply
#6

1. application\config\database.php
 'database' => 'database_name'

2. Depends on how your CMS are coded. Menus etc are generally depending on $config['base_url'] set in application\config\config.php. But if your application includes WYSIWYG, they need to be edited that way. Or search and replace in database.

3. Maybe, hard to tell without any code.

4. You got Profiler turned on:
https://www.codeigniter.com/userguide3/g...iling.html
Reply




Theme © iAndrew 2016 - Forum software by © MyBB