Jump to content

Hosting Provider Upgraded Php To Latest. Site Delivers Errors. Please Help.


hwaveblue

Recommended Posts

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

Link to comment
Share on other sites

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 by ManiacDan
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.