Help! I need to convert from mysql to mysqli

Permalink 1 user found helpful
Hi!
My webhost recently changed to PHP 7. In the process I've lost several of my websites as they come up with 500 errors now!! Those sites are installed on Concrete5 version 5.6.3.1.

The actual error message is:

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/bestlei2/public_html/edithleigh.com/concrete/libraries/3rdparty/adodb/drivers/adodb-mysql.inc.php:442 Stack trace: #0 /home/bestlei2/public_html/edithleigh.com/concrete/libraries/3rdparty/adodb/adodb.inc.php(557): ADODB_mysql->_connect('localhost', 'bestlei2_eleigh', '[email protected]', 'bestlei2_eleigh') #1 /home/bestlei2/public_html/edithleigh.com/concrete/libraries/3rdparty/adodb/adodb.inc.php(4358): ADOConnection->Connect('localhost', 'bestlei2_eleigh', '[email protected]', 'bestlei2_eleigh') #2 /home/bestlei2/public_html/edithleigh.com/concrete/libraries/3rdparty/adodb/adodb.inc.php(4194): ADONewConnection('mysqlt') #3 /home/bestlei2/public_html/edithleigh.com/concrete/core/libraries/loader.php(251): NewADOConnection('mysqlt://bestle...') #4 /home/bestlei2/public_html/edithleigh.com/concrete/startup/exceptions.php(6): Concrete5_Library_Loader::db() #5 [internal function]: Concrete5_Exception_Handler(Object(Error)) #6 {main} thrown in /home/bestlei2/public_html/edithleigh.com/concrete/libraries/3rdparty/adodb/drivers/adodb-mysql.inc.php on line 442

I also have another couple of sites installed on 5.7.5.13 which are still working perfectly, with the same host.

I've tried installing 5.7.5.13 on one of the sites that is no longer working.. and it hasn't changed a thing!! It's still not working. So it still comes up with the same 500 error!

So.. after long chat sessions with my hosting provider it turns out that my error logs are saying that what I actually need to do is convert from mysql to mysqli.

Sorry, but I have no idea how to do this. :(

I'm at a total loss, and at my wit's end!

If anyone out there can help me.. I would be eternally greatful!!

Warmly,
Edith :)

brisseo
View Replies: View Best Answer
enlil replied on at Permalink Reply
enlil
If you update those sites to 5.6.3.5 they should run appropriately. I believe mysqli was implemented in 5.6.3.4, and as of 5.6.3.5 you can run up to php7.2. Anything in the c5 5.7+ versions is a whole new ballgame, and your sites would need to be migrated or rebuilt if you choose that path.
jasteele12 replied on at Permalink Reply
jasteele12
@enlil is right - your best bet it to upgrade to the latest 5.6.3.5 - but you would need to downgrade PHP first.

Most host control panels will allow you to use an older version 5.x of PHP - so you could do the concrete5 upgrades, then switch over to the faster PHP 7.x
brisseo replied on at Permalink Reply
brisseo
@ jasteele12... In one of my chat sessions with my hosting provider he said " Ah ok, it looks like PHP 5.6 was permanently removed from the server last month.."

I'm guessing that means I can't use the older version.. even temporarily.
jasteele12 replied on at Permalink Reply
jasteele12
Bummer Edith - I would immediately switch hosting providers away from anyone that pulled something like that!
brisseo replied on at Permalink Reply
brisseo
I know.. right!! I've tried switching from them a few years ago.. but landed with a much worse provider!!

Any tips on good, inexpensive webhosts with great customer service?
brisseo replied on at Permalink Reply
brisseo
@ enlil.. Thanks for that info.. it's really valuable to me as I didn't know everything changed from 5.7!

Ok so I uploaded 5.6.3.5 as you suggested and now it has come up with a whole new bunch of errors.

This is what it says...

Warning: Declaration of Concrete5_Model_Page::add(CollectionType $ct, $data) should be compatible with Concrete5_Model_Collection::add($data) in /home/bestlei2/public_html/edithleigh.com/concrete/core/models/page.php on line 12

Warning: Declaration of Concrete5_Model_Page::duplicate($nc, $preserveUserID = false) should be compatible with Concrete5_Model_Collection::duplicate() in /home/bestlei2/public_html/edithleigh.com/concrete/core/models/page.php on line 12

Warning: Declaration of Concrete5_Model_EditPagePropertiesPagePermissionAccess::save($args) should be compatible with Concrete5_Model_PermissionAccess::save() in /home/bestlei2/public_html/edithleigh.com/concrete/core/models/permission/access/categories/custom/edit_page_properties.php on line 0

Warning: Cannot modify header information - headers already sent by (output started at /home/bestlei2/public_html/edithleigh.com/concrete/core/models/page.php:12) in /home/bestlei2/public_html/edithleigh.com/concrete/core/libraries/view.php on line 963

Warning: Cannot modify header information - headers already sent by (output started at /home/bestlei2/public_html/edithleigh.com/concrete/core/models/page.php:12) in /home/bestlei2/public_html/edithleigh.com/concrete/core/libraries/view.php on line 657

I just noticed the details on the installation on softaculous.. it says that the software is Concrete5 5.7.. and the version is 5.6.3.1!! How can that be possible??

I'm guessing that may be my major problem.. a whole misconfiguration??

It's driving me crazy!!

PS. The 500 Error seems to be gone though lol
weyboat replied on at Permalink Reply
weyboat
Text Deleted
weyboat replied on at Permalink Reply
weyboat
Offer of help withdrawn!
brisseo replied on at Permalink Reply
brisseo
Hi Weyboat,

I look forward to what you may come up with.
weyboat replied on at Permalink Reply
weyboat
Text deleted
weyboat replied on at Permalink Best Answer Reply
weyboat
Hi Edith
All finished..
I have done some serious cleaning and optimisation of the system also added
3 new files for keeping your system running smoothly.
1. Clear Clipboard - just cleans out any redundant files held in memory
2. Clean Stats - clears out old statistics log files.
3. Non Approved - Clears out all old page versions

Your site should run much faster and smoother now.
Your new login password has been emailed to you and you can change this by using the
forgotten password utility on the login page.

You should notice quite a few new enhancements and I hope you enjoy your
restored site..

http://www.edithleigh.com/

Incidentally, your web hosting is extremely slow and rather unstable, I
would find a better hosting company if possible.

Best Regards
David
weyboat replied on at Permalink Reply
weyboat
Well, what can I say?
After spending several hours rebuilding this site to work on PHP7 and doing some serious optimization of the database and file system.
I was expecting at least a 'Thank You'.
Instead @brisseo has just ignored me, emails PM's and all.
I wish I had not bothered now!
brisseo replied on at Permalink Reply
brisseo
Hi again!

I am so sorry I haven't responded to you, I've been away for a couple of days and had no internet access.

I'd hate to think that after your enormous effort.. you feel unappreciated. Nothing could be further from the truth.. I really truly appreciate your time, skills and kindness in helping me.

Thank you so much once again.

Warmest Regards,
Edith
brisseo replied on at Permalink Reply
brisseo
Hi David,

Thank you soooo much for all of your help. I am overwhelmed with how much you've helped me by not only restoring my site but optimising the back end as well!

WOW! In "Aussie" terms.. you're a true legend!! (It's a complement :) )

The most I expected was a "clear as mud" answer (lol).. but instead you must've invested a load of your time helping a person you've probably not even seen on this forum before.

It's the dedication and passion of people like you that make me want to stick with concrete5 (and this amazing community) despite wanting to give up so many times.

Thankyou, thankyou, thankyou!!

If you'd like one of those koala pins on my site... I'd be happy to send you one. ;)

Warmest Regards,
Edith :)
weyboat replied on at Permalink Reply
weyboat
Hi Edith
Thanks for clearing that up..
I was feeling a bit disappointed, all okay now though.
I would love to take you up on your Koala Pin offer, I am sure my wife would be delighted to receive one..
I will send you my address by PM.
Regards
David
weyboat replied on at Permalink Reply
weyboat
I also meant to say..
I put your site into maintenance mode to install an email obfuscation add-on, but you can do this yourself, just install it and it will automatically do the rest for you.
It is available here..
https://www.concrete5.org/marketplace/addons/automatic-email-obfusca...
brisseo replied on at Permalink Reply
brisseo
Seriously, it's the least I can do! I hope she likes it :)

Oh, and thanks for the email obfuscator.. I'm about to install it now.