projectnami icon indicating copy to clipboard operation
projectnami copied to clipboard

Error establishing a connection after PHP Upgrade

Open Skiddoh opened this issue 2 years ago • 8 comments

Hello everyone, today i upgraded PHP from 7.3.1 to 7.4. and now im having trouble using wordpress (projectnami). This was shown to me in the wordpress dashboard, and suggested because of better performance and security.

While trying to fix the issue i also upgraded projectnami to version 3.0.1 but that didn't help either. I've reset the sql server users password to make sure i have set it to the right one.

I have to explain, that before i upgraded to the new PHP version everything was working. Currently neither PHP or Apache show any errors in their logs, but i still receive "Error establishing a database connection" on opening the site. I also used the sql users credential and connected to the wordpress DB successfully and have been able to open all shown wordpress tables.

Does anybody have a clue on how to fix this?

Skiddoh avatar Sep 28 '22 00:09 Skiddoh

I may need to add, that a different vhost is using the same sql express server and a different login without any issues.

futhermore, even switching back to php 7.3.1 and old projectnami version would resolve this issue.

Skiddoh avatar Sep 28 '22 00:09 Skiddoh

Is this an Azure Web App? If not, as part of the upgrade did you also upgrade the SQL Server library for PHP?

patrickebates avatar Sep 28 '22 00:09 patrickebates

It's hosted on an dedicated server, not on azure.

Yes I updated the sqlsrv drivers as well (I think from 5.7. to 5.8.) and switched from the 73 version to 74 version

Skiddoh avatar Sep 28 '22 06:09 Skiddoh

Any resolution to this yet? I am having the same issue whether I go to PHP 7.4, 8.0 or 8.1. Always get the same error establishing connection to DB. Reverting back to 7.3.2 always resolves it immediately as well. Tried configuring wp-config.php for a repair and then running the repair page but same DB error. Please advise.

rbackus57 avatar Feb 12 '23 22:02 rbackus57

I haven't been able to figure this out on my own. I haven't tried to update since the post either, but seems like it's still an issue.

Skiddoh avatar Feb 12 '23 23:02 Skiddoh

For the sake of argument, have you tried using the php.ini from the PHP 8.1 distribution I added here for use with Azure?

https://github.com/ProjectNami/php-azure-windows-web-app/blob/main/php.ini

patrickebates avatar Feb 13 '23 02:02 patrickebates

Yes, very frustrating.

From: Skiddoh @.> Sent: Sunday, February 12, 2023 6:28 PM To: ProjectNami/projectnami @.> Cc: Rick Backus @.>; Comment @.> Subject: Re: [ProjectNami/projectnami] Error establishing a connection after PHP Upgrade (Issue #484)

I haven't been able to figure this out on my own. I haven't tried to update since the post either, but seems like it's still an issue.

— Reply to this email directly, view it on GitHubhttps://github.com/ProjectNami/projectnami/issues/484#issuecomment-1427162922, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFNKLZWLVB6BZI55667MWGDWXFWZBANCNFSM6AAAAAAQXINR4U. You are receiving this because you commented.Message ID: @.@.>>

rbackus57 avatar Feb 19 '23 17:02 rbackus57

Patrick,

Thanks for the reply and advice. Unfortunately, even with your php.ini file, I am still having the same DB connection issue.

Rick Backus Cybercon Services LLChttp://blog.cybercon1.com/ Mobile: 610.745.2481 Twitter: RickBackus @.***

From: Patrick Bates @.> Sent: Sunday, February 12, 2023 9:20 PM To: ProjectNami/projectnami @.> Cc: Rick Backus @.>; Comment @.> Subject: Re: [ProjectNami/projectnami] Error establishing a connection after PHP Upgrade (Issue #484)

For the sake of argument, have you tried using the php.ini from the PHP 8.1 distribution I added here for use with Azure?

— Reply to this email directly, view it on GitHubhttps://github.com/ProjectNami/projectnami/issues/484#issuecomment-1427232779, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFNKLZRAMBCPKJ7O23SVKPTWXGK5ZANCNFSM6AAAAAAQXINR4U. You are receiving this because you commented.Message ID: @.@.>>

rbackus57 avatar Feb 19 '23 17:02 rbackus57