hwaveblue Posted October 5, 2012 Share Posted October 5, 2012 Hi there, my hosting provider upgraded PHP yesterday to latest and now the site is showing these kinds of errors: Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash in /home/USERNAME/public_html/SCRIPT_FOLDER/include/misc.inc.php on line 309 Warning: preg_replace() [function.preg-replace]: No ending delimiter ';' found in /home/USERNAME/public_html/SCRIPT_FOLDER/include/misc.inc.php on line 121 The developer is no longer reachable and the site is few years old. I tried to play with the code but I have no php experience and I might have broken more than fixed, I used http://php.net/manual/en/migration53.deprecated.php as refference, but to no success. Can anyone here help please? I am attaching the misc.inc.php file if this is something that is to be fixed only modofying stuff in this file? Thanks! misc.inc.txt Quote Link to comment https://forums.phpfreaks.com/topic/269127-hosting-provider-upgraded-php-to-latest-site-delivers-errors-please-help/ Share on other sites More sharing options...
scootstah Posted October 5, 2012 Share Posted October 5, 2012 The file you attached isn't representative of the errors you have. There is no preg_match or preg_replace on lines 309 or 121. Most likely you didn't add delimiters to your regular expressions, since the ereg_* functions don't need them. Quote Link to comment https://forums.phpfreaks.com/topic/269127-hosting-provider-upgraded-php-to-latest-site-delivers-errors-please-help/#findComment-1382935 Share on other sites More sharing options...
ManiacDan Posted October 5, 2012 Share Posted October 5, 2012 (edited) Your host upgraded from a language version which supports the ereg family of functions to a version which does not. They also "helpfully" added a module which replaces any existing calls to ereg with calls to the preg family of functions. Your code on those lines is wrong. Line 121 should be: $output = str_replace(";", "", $output); Line 309 should be: if ($count % 10 == 0 ) { This code is awful, neither of these lines even needed to be a regular exp<b></b>ression. Any line which contains "ereg" must be replaced by something. Scoot: The host seems to be doing real-time aliasing between ereg and preg since ereg is gone. Edited October 5, 2012 by ManiacDan Quote Link to comment https://forums.phpfreaks.com/topic/269127-hosting-provider-upgraded-php-to-latest-site-delivers-errors-please-help/#findComment-1382938 Share on other sites More sharing options...
scootstah Posted October 5, 2012 Share Posted October 5, 2012 Scoot: The host seems to be doing real-time aliasing between ereg and preg since ereg is gone. That is a terrible idea. Quote Link to comment https://forums.phpfreaks.com/topic/269127-hosting-provider-upgraded-php-to-latest-site-delivers-errors-please-help/#findComment-1382949 Share on other sites More sharing options...
ManiacDan Posted October 5, 2012 Share Posted October 5, 2012 No kidding. But it keeps fatal errors out of their logs, presumably they log fatal errors only. Aliasing all the missing functions (missing functions are a fatal error) to similar-but-not-working functions stops them from filling their logs with "FATAL ERROR: Customer has not updated their script in 6 years" over and over until the server goes down. Quote Link to comment https://forums.phpfreaks.com/topic/269127-hosting-provider-upgraded-php-to-latest-site-delivers-errors-please-help/#findComment-1382962 Share on other sites More sharing options...
Christian F. Posted October 5, 2012 Share Posted October 5, 2012 Oh, my... I'm glad none of my hosts have pulled such a stunt. Hopefully it's possible to turn the module off, and have it stay off forever. While I do understand the reasoning behind keeping the error logs down to size, they really should have limited the log file's size instead. Using a third party module to mess with the internal workings of a programming language like this, in order to cut down on the number of errors reported (and thus logged), is no excuse for not properly configuring the error log handler. hwaveblue: I've sent you a PM regarding this issue, in case you haven't seen it yet. Quote Link to comment https://forums.phpfreaks.com/topic/269127-hosting-provider-upgraded-php-to-latest-site-delivers-errors-please-help/#findComment-1382972 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.