Updating PHP to 7.4.6 Fatal error
Posted by: magicalwonders (---.40.171.214.threembb.co.uk)
Date: May 25, 2020 09:14PM

Hello,

I am trying to update my WampServer 3.1.4 64bit with the latest version of PHP 7.4.6 but I must have missed a step as I am getting a fatal error when trying to view any of the sites.

I have created a folder in Wamp64/bin/php called php7.4.6

I've then downloaded version 7.4.6 and extracted contents to my new folder.

I've copied over three files to this folder from version 7.2.10

php.ini
PhpForApache
wamp.conf

I've edited the php.ini at line 741 to read extension_dir ="c:/wamp64/bin/php/php7.4.6/ext/"

When restarting Wamp I can select version 7.4.6 and PHP restarts successfully.

However, when I try to view any sites, I get a fatal error like the following-

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\wamp64\www\finaltouchglobal\wp-includes\wp-db.php:1661 Stack trace: #0 C:\wamp64\www\finaltouchglobal\wp-includes\wp-db.php(631): wpdb->db_connect() #1 C:\wamp64\www\finaltouchglobal\wp-includes\load.php(426): wpdb->__construct('root', '', 'ftg', 'localhost') #2 C:\wamp64\www\finaltouchglobal\wp-settings.php(126): require_wp_db() #3 C:\wamp64\www\finaltouchglobal\wp-config.php(90): require_once('C:\\wamp64\\www\\f...') #4 C:\wamp64\www\finaltouchglobal\wp-load.php(37): require_once('C:\\wamp64\\www\\f...') #5 C:\wamp64\www\finaltouchglobal\wp-blog-header.php(13): require_once('C:\\wamp64\\www\\f...') #6 C:\wamp64\www\finaltouchglobal\index.php(17): require('C:\\wamp64\\www\\f...') #7 {main} thrown in C:\wamp64\www\finaltouchglobal\wp-includes\wp-db.php on line 1661

There has been a critical error on your website.

It looks like some sort of database issue, but I'm a bit lost on how to fix it.

If anyone can advise, it would be much appreciated.

Myles

Options: ReplyQuote
Re: Updating PHP to 7.4.6 Fatal error
Posted by: Otomatic (Moderator)
Date: May 25, 2020 10:25PM

Hi,

Let me be very clear: When you don't have the skills to do something, you don't do it.

- 1 - The PHP 7.4.6 addon for Wampserver 3.2.2 64bit is here: PHP 7.4.6 64 bit x64

- 2 - This addon was announced on May 12, 2020 at 6:33 pm via a message on this forum:
[forum.wampserver.com]

- 3 - Are you sure the version of WordPress you have supports PHP 7.4.6?

So, you go back to the PHP version you were using before making your mistakes, you completely delete the php7.4.6 folder and its contents, you check that you have not broken Wampserver or your WordPress, you install the PHP 7.4.6 addon mentioned above, and before switching to another PHP version, you find out if your version of WorPress supports PHP 7.4.6.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Updating PHP to 7.4.6 Fatal error
Posted by: magicalwonders (---.40.171.214.threembb.co.uk)
Date: May 25, 2020 11:09PM

Many thanks for your help. It is much appreciated. smiling smiley

I wasn't aware of the PHP 7.4.6 addon. I just went to the download page for the latest version.

The site I tested is using the latest version of Wordpress, although some of the sites I have in Wamp are older versions.

I can switch back to earlier versions of PHP in Wamp and everything works well, so I haven't broken anything.

So does the addon basically do what I was trying to do manually?

Options: ReplyQuote
Re: Updating PHP to 7.4.6 Fatal error
Posted by: Otomatic (Moderator)
Date: May 26, 2020 08:28AM

Hi,

> So does the addon basically do what I was trying to do manually?

It does many other things, and these "other things" for the most part, have been seen and prepared in advance and that you have not done, for example :
- Evolution of php.ini (phpForApache.ini) compared to the previous version
- Evolution of the icu version from 65 to 66
- xDebug version upgrade

And furthermore..:
- php.ini in PHP 7.2.10 is totally incompatible with PHP 7.4.6.
- you say you downloaded PHP 7.4.6, yes, but where and which version.

Adding a version of PHP, i.e. creating an addon, is following a strict procedure that requires a lot of checking, comparison and validation tests. With older versions of PHP (5.3, 5.4, 5.5 and a little less 5.6) you could proceed as you did, but not anymore with PHP 7.

So, keep up to date with developments by following the discussion WAMPserver 3 - All you need to know and periodically checking http://wampserver.aviatechno.net

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Updating PHP to 7.4.6 Fatal error
Posted by: magicalwonders (---.40.170.183.threembb.co.uk)
Date: May 26, 2020 09:26AM

Many thanks for the info.

My knowledge of PHP is limited, so I don't have the expertise that you and other forum users have.

I use WAMP to build and test Wordpress sites before putting them in a live environment. So my involvement with php in recent years has been negligible, to say the least. I pay for a managed hosting service as I thought they would tale care of that end of things. From what I have now read recently about the volume of users with outdated php on their servers, I am beginning to wonder!

I downloaded VC15 x64 Thread Safe (2020-May-12 15:28:43) from this link - [windows.php.net]

Thanks for the link. I'll bookmark that, and try and keep up to date!

Options: ReplyQuote


Sorry, only registered users may post in this forum.