February 27, 20197 yr Hi All, I'm new to this forum, and was wondering if any of you would know how to help. The company I work for has what is now considered an old website (a new build is in the words), it has worked OK and the companies that we work with on a B2B basis, can log in to the website to access otherwise inaccessible pages, where they can learn about the products we supply and how to use them. Yesterday, a few customers reported (and we later confirmed) that the login portal was no longer functioning, and displaying the below error: Fatal error: Uncaught Error: Call to undefined function eregi() in /home/louisgat/public_html/skinmed.co.uk/includes/functions.php:52 Stack trace: #0 /home/louisgat/public_html/skinmed.co.uk/includes/functions.php(168): valid_email('office@skinmed....') #1 /home/louisgat/public_html/skinmed.co.uk/login.php(21): requestLogin() #2 {main} thrown in /home/louisgat/public_html/skinmed.co.uk/includes/functions.php on line 52 Nothing has been changed on the website recently, so we've not broken it This is outside of my knowledge of websites, and I can't see what's causing it, has anyone else experienced an issue like this before and know a fix, or could please point me in the right direction? Thanks Edited February 27, 20197 yr by Peter.C Update with tags and poll
February 27, 20197 yr Hi Peter, The error you are getting is because the eregi() function no longer exists. The eregi() function was deprecated in php 5.3.0 and has been completely removed in php7. I suspect whomever you host with has upgraded to php7 and this is why you are seeing this error. You may be able to talk to your hosting provider about downing your php version to one in the 5.6.x version. Hope this helps!
February 27, 20197 yr If you can fix the error, avoid downgrading to 5. Version 5 is no longer supported and won't receive security patches and upgrades. I'd be surprised if your web host even let you. In most cases, PHP 7 deprecation errors are fairly easy to fix because they typically have a newer equivalent version. In your example above, the eregi() function can be replaced with preg_match() instead.
February 27, 20197 yr Author Thanks Jack, we'll give that a go. Would we need to do a simple find and replace? And would we need to do this site-wide?
February 27, 20197 yr Author It's now providing the following error: Warning: preg_match(): No ending delimiter '^' found in /home/louisgat/public_html/skinmed.co.uk/includes/functions.php on line 52
February 27, 20197 yr Author Got it working, there was a hidden '!' before eregi which messed things up, but it's functioning now - thanks for your help guys.
Create an account or sign in to comment