4

Long time reader, first time poster,

I found this error pinging a webservice from my app after doing a migration to php 7.2 hosting environment from 5.6:

PHP Fatal error:  Uncaught Error: Call to undefined function mysql_connect() in …system/database/drivers/mysql/mysql_driver.php

After some research, this looked like a simple one line fix in codeigniter framework from: $db['default']['dbdriver'] = 'mysql'; to:

$db['default']['dbdriver'] = 'mysqli';

When I make a server request from the app after this change, my error log returns nothing but is still not loading in the app as before. I have read other posts on the topic suggesting I would need to make other mysql->mysqli changes, tried doing this in driver files also with no luck.

TheRealTG
  • 53
  • 1
  • 4
  • if you switch from 5.6 to 7.2 you should get informed about the consequences ... a simple one liner won't solve your problem here - at first you've to provide information about your CI Version, The next step would be to turn off all error and warning messages - i'm pretty sure there will arise a ton of them. And what do you mean with _is still not loading in the app as before_ ? this information isnt really helpful. – Atural Mar 10 '19 at 12:09
  • CI version is 2.2. Here is the reference which I was hoping would work. https://stackoverflow.com/questions/21540622/codeigniter-switching-driver-from-mysql-mysqli I post from the app looking for a response from the server - I get the error message using 'mysql' as the database config, and no response or error message at all with 'mysqli' – TheRealTG Mar 10 '19 at 18:37
  • 1
    you think its only your DB driver - but thats simply wrong, there are a ton of another problems (session, driver,..). CI2.2 reached EOL ~4 years ago - how can you expect that your app would work on PHP 7.2 ? PHP 7.0 came out on 3. December 2015 - CI 2.2 had already reached EOL at this time - it doesn't make any sense to upgrade the php version - you have to upgrade your CI Version to 3.1.10 @first... in short CI 2.2 is simply not PHP 7.2 compatible. – Atural Mar 11 '19 at 07:57
  • I migrated the server primarily for a second app also in this hosting account. That one is working fine on the new server. The only error that was thrown for either was this one reference above. – TheRealTG Mar 11 '19 at 13:08
  • 1
    And heho, welcome to upvote levels ;-) – GhostCat Jun 21 '19 at 14:09

1 Answers1

-3

In the hosting change PHP version to 5.6 is more easy that change code lines. Need working in similar work spaces.

  • 2
    Please try to avoid advice about using software that reached EOL( https://www.php.net/eol.php ) at the time of writing this comment php5.6 is without maintenance for at least 1 year and 5 months – Rafael Rotelok Jun 10 '20 at 22:37