• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issues regarding website with old code

#1
Hello all,

I'm currently maintaining a website for someone. The site worked most of the time correctly, but since the webhost upgraded to PHP 7, the website does not work anymore.

I discovered the website is using CI 2.0.2. I got the same errors in debugging as:

https://stackoverflow.com/questions/4384...p-to-php-7

And solved them all. But still the page keeps blank. When I go into the log files I get this:

[Sat Jan 04 23:38:57.942225 2020] [fcgid:warn] [pid 4267] [client xxx] mod_fcgid: stderr: PHP Fatal error:  Uncaught Error: Call to undefined method CI_DB_mysql_driver::initialize() in /home/xxx/domains/xxx.nl/public_html/system/database/DB.php:146
[Sat Jan 04 23:38:57.942250 2020] [fcgid:warn] [pid 4267] [client xx] mod_fcgid: stderr: Stack trace:
[Sat Jan 04 23:38:57.942255 2020] [fcgid:warn] [pid 4267] [client xx] mod_fcgid: stderr: #0 /home/xxx/domains/xxx.nl/public_html/application/third_party/MX/Loader.php(94): DB(Array, NULL)
[Sat Jan 04 23:38:57.942260 2020] [fcgid:warn] [pid 4267] [clientxx] mod_fcgid: stderr: #1 /home/xxx/domains/xxx.nl/public_html/system/core/Loader.php(1024): MX_Loader->database()
[Sat Jan 04 23:38:57.942264 2020] [fcgid:warn] [pid 4267] [clientxx] mod_fcgid: stderr: #2 /home/xxx/domains/xxx.nl/public_html/system/core/Controller.php(53): CI_Loader->_ci_autoloader()
[Sat Jan 04 23:38:57.942269 2020] [fcgid:warn] [pid 4267] [client xxx] mod_fcgid: stderr: #3 /home/xxx/domains/xxx.nl/public_html/application/core/Public_Controller.php(13): CI_Controller->__construct()
[Sat Jan 04 23:38:57.942274 2020] [fcgid:warn] [pid 4267] [client xx] mod_fcgid: stderr: #4 /home/xxx/domains/xxx.nl/public_html/application/modules/producten/controllers/producten.php(9): Public_Controller->__construct()
[Sat Jan 04 23:38:57.942278 2020] [fcgid:warn] [pid 4267] [client xx] mod_fcgid: stderr: #5 /home/xx/domains/xxx.nl/public_html/system/core/CodeIgniter.php(288): Producten->__construct()
[Sat Jan 04 23:38:57.942283 2020] [fcgid:warn] [pid 4267] [client xxx] mod_fcgid: stderr: #6 /home/xxx/domains/xxx.nl/public_html/index.php(200): require_once('/home/xxx/d...')
[Sat Jan 04 23:38:57.942287 2020] [fcgid:warn] [pid 4267] [client xx] mod_fcgid: stderr: #7 {mai in /home/xx/domains/xxx.nl/public_html/system/database/DB.php on line 146


I'm not that expert on debugging and not familiair with C.I. How can I resolve the issue?

When i disabled the initialize () calls (as I added __construct()) I get:

[Sat Jan 04 23:54:36.612571 2020] [fcgid:warn] [pid 2450] [clientxx] mod_fcgid: stderr: PHP Fatal error:  Uncaught Error: Call to undefined function mysql_query() in /home/xx/domains/xxx.nl/public_html/system/database/drivers/mysql/mysql_driver.php:163

Is there a config setting to switch to mysqli? Or do I need to do something else?
Reply

#2
You should upgrade ASAP. As there are plenty of other functions than mysql that aren't working as they should with PHP7.
https://codeigniter.com/user_guide/insta...ading.html

You can change driver in application/config/database.php
Reply

#3
I changed the driver, still got some errors and all the products from the top/left menu were missing.

When I want to go from 2.0.2 to 3.1, do I really have to follow about 20 upgrade pages?
Reply

#4
You don't need to download all 2.x and 3.x versions and apply all system folders (or application/config). You can grab the latest. So no need to go 3.0.1 to 3.0.2 etc, you can jump to the latest. But replace all files mentioned with the latest version.

But you should read all upgrade pages, as they contain information about deprecated functions.

Personally I had a development with PHP 5 the last time I upgraded and upgraded to the latest 2.x before upgrading into 3.x. So that I knew where I broke stuff. :-)
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.