PHP 7 issues

Permalink
I have Concrete5 installed on a couple of sites and recently had to upgrade the server to a newer php. I saw that the first site with concrete5 had issues, so updated it to the latest version and everything seems to work. I then did exactly the same thing to the second site and I'm getting:

An unexpected error occurred.
could not find driver

with no additional information as to what the problem might be. How can I debug this and get the site back running? (The site is in development, and currently is pretty much just the initial install, so it shouldn't be related to customization)

View Replies: View Best Answer
jero replied on at Permalink Reply
jero
A bit more information would be helpful - which version of concrete5? If you're using <5.7.5.4 you're not going to have much luck at all with PHP7. The "latest" version has changed several times already this year. PHP7 drops support for mysql in favour of mysqli and PDO, so anything less than 5.6.3.4 won't be able to access the database but there are other problems with 5.6 on PHP7 so you'd be better off with 5.X

I'd also be inclined to remove everything in application/files/cache if you can't log in to disable and clear the cache manually.

Is there anything in your web server log files that might shed any light on the matter?
billsey replied on at Permalink Reply
Sorry, by latest version I mean the 5.7.5.6 release. I'll give clearing the cache a try...
billsey replied on at Permalink Reply
No change with the cache cleared.
jero replied on at Permalink Reply
jero
OK, seeing as you're dead in the water, try this:
Make a backup of application/config/generated_overrides/concrete.php

Normally you should *not* edit this file, but needs must..

Open it in a text editor and look for something that looks like this:

'debug' => array(
        'detail' => 'message',
        'display_errors' => true,
    ),


and edit it carefully so it looks like this:

'debug' => array(
        'detail' => 'debug',
        'display_errors' => true,
    ),


Save that and open the site in your browser. Hopefully you'll see a more detailed error message now.

If anything goes wrong, replace the file with the copy you made.
billsey replied on at Permalink Reply
Ok, lots of info now. PDOConnection.php lines 40-49 displayed, looks like it hasn't done the upgrade fully.

Concrete5
Version 5.7.5.6
Installed Version 5.7.5.1

Issue might be related to imagemagick, which isn't quite ready for 7.0, I have RC6 installed. Anything I should be looking for in the error display?
jero replied on at Permalink Reply
jero
I can imagine it would blow up spectacularly if you're <5.7.5.4 with PHP7. 5.7.5.4. was the first version that actually worked with PHP7, so you're going to struggle.

You could, possibly, try replacing the concrete folder with the one from 5.7.5.6 and then running the upgrade again using the url: /index.php/ccm/system/upgrade?force=1

replacing the old concrete folder with the 5.7.5.6 version should remove any PHP7 compatibility issues. Also check that application/config/update.php (or maybe upgrade.php I can't quite rememeber) is moved out of the way since that will cause the concrete fodler to be ignored.

Failing that Your best bet is to go back to 5.X and upgrade on that then switch back to 7, or transplant everything to another host that's running 5.x, upgrade there and then upload back to the PHP7 host.
jero replied on at Permalink Reply
jero
... and back up the DB before doing anything!
billsey replied on at Permalink Reply
Heheh, I have a script running that backs the databases up every few hours, and the backups are synced to the cloud.

Whoops \ Exception \ ErrorException (E_CORE_WARNING)

PHP Startup: Unable to load dynamic library 'C:\PHP\v7.0\ext\php_imagick.dll' - The specified module could not be found.

Any way to bypass the imagick load?
jero replied on at Permalink Reply
jero
Image Magick is usually configured in the php.ini file - it is in Unix builds anyway. I'd therefore check that php.ini is referencing the dll and comment out/remove that line.
billsey replied on at Permalink Reply
Closer and closer... I commented out imagick (though I'll have to fix that for real once they release a new version, since other sites I host require it) and copied php_sqlsrv.dll from the older version and that got me to this:

An exception occurred while executing 'SELECT t0.issID AS issID1, t0.customClass AS customClass2, t0.backgroundColor AS backgroundColor3, t0.backgroundImageFileID AS backgroundImageFileID4, t0.backgroundRepeat AS backgroundRepeat5, t0.backgroundSize AS backgroundSize6, t0.backgroundPosition AS backgroundPosition7, t0.borderColor AS borderColor8, t0.borderStyle AS borderStyle9, t0.borderWidth AS borderWidth10, t0.borderRadius AS borderRadius11, t0.baseFontSize AS baseFontSize12, t0.alignment AS alignment13, t0.textColor AS textColor14, t0.linkColor AS linkColor15, t0.marginTop AS marginTop16, t0.marginBottom AS marginBottom17, t0.marginLeft AS marginLeft18, t0.marginRight AS marginRight19, t0.paddingTop AS paddingTop20, t0.paddingBottom AS paddingBottom21, t0.paddingLeft AS paddingLeft22, t0.paddingRight AS paddingRight23, t0.rotate AS rotate24, t0.boxShadowHorizontal AS boxShadowHorizontal25, t0.boxShadowVertical AS boxShadowVertical26, t0.boxShadowBlur AS boxShadowBlur27, t0.boxShadowSpread AS boxShadowSpread28, t0.boxShadowColor AS boxShadowColor29, t0.hideOnExtraSmallDevice AS hideOnExtraSmallDevice30, t0.hideOnSmallDevice AS hideOnSmallDevice31, t0.hideOnMediumDevice AS hideOnMediumDevice32, t0.hideOnLargeDevice AS hideOnLargeDevice33 FROM StyleCustomizerInlineStyleSets t0 WHERE t0.issID = ?' with params ["8"]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.backgroundSize' in 'field list'
I'm thinking of reinstalling from scratch, since the upgrade seems to be so broken...
MrKDilkington replied on at Permalink Reply
MrKDilkington
@billsey

This bug thread has a solution for this:
https://www.concrete5.org/developers/bugs/5-7-5-6/an-exception-occur...
jero replied on at Permalink Best Answer Reply
jero
..and at the risk of repeating myself. Make sure you've run the upgrade

/index.php/ccm/system/upgrade?force=1
billsey replied on at Permalink Reply
I feel like I'm getting closer, but sometimes I wonder about my feelings. :)

I get the nifty error pages once in a long while when trying the upgrade (I've disabled the php_sqlsrv.dll and php_pdo_sqlsrv.dll loads, since they were the errors I saw), the rest of the time I get 'Access Denied', with no indication what I was trying to access when it was denied.

And now when I try to post I get 'Invalid Token'. :(
billsey replied on at Permalink Reply
And it finally worked. I had two tabs open, one to the dashboard (which had started working yesterday), one to the error Access Denied. I opened a third tab to the update page and it showed me an Update button! I did the update from the button and it went through successfully. The website is once again visible. :)

Sure wish I knew what was really going on though.
jero replied on at Permalink Reply
jero
Glad you've got it all sorted. No idea why you've been struggling, but at least now the upgrde is done you're good to go.

The "'Invalid Token" thing happens when you click reply on a page that you've had open for a while - it's a security thing to prevent misuse of the form.