1

The site is very complex, with thousands of functions and millions of lines of code, far too much to debug line by line at this stage.

We have moved from Apache to Nginx and set the site up. It's running much faster, however some areas are not working.

Some of php's default functions are not working / not working properly. I've found one thing, which we use for adding / editing comments, that is not working.

$comment = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)',
    '\\1<a href="https://\\2" target=_blank>\\2</a>', $comment);

This results in comment the variable to be blank and causes blank values to be inserted into the database in discussions.

Example: This just being one very small area, what I am looking to for is if HHVM can run alongside PHP/Apache encase it fails in a request so that the request operates via PHP/Apache.

Any advice on this would be greatly received.

Arne Claassen
  • 14,088
  • 5
  • 67
  • 106
Lin W
  • 47
  • 2

2 Answers2

0

This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.

http://docs.hhvm.com/manual/en/function.eregi.php

You should use preg_match with the -i flag instead.

You should probably consider using some sort of error logging as well to pick up on these errors.

max
  • 96,212
  • 14
  • 104
  • 165
0

Take a look at Etsy's experiences migrating from PHP to HHVM:

https://codeascraft.com/2015/04/06/experimenting-with-hhvm-at-etsy/

They used a tee on their load balancer to duplicate traffic to both PHP implementations, and compare results.

The main quote:

You can think of “tee” in this sense like tee on the command line. We wrote an iRule on our f5 load balancer to clone HTTP traffic destined for one pool and send it to another. This allowed us to take production traffic that was being sent to our API cluster and also send it onto our experimental HHVM cluster, as well as an isolated PHP cluster for comparison.

Essentially Etsy duplicated their requests - the request was sent to both the original PHP interpreter as well as to HHVM. The customer was only returned the value from the original PHP interpreter, but it was also compared to the output of HHVM to polish out any issues.

Here are some options for creating a tee:

Duplicate TCP traffic with a proxy

Community
  • 1
  • 1
Martin Konecny
  • 57,827
  • 19
  • 139
  • 159