crkm
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: preg_match(): Compilation failed at wp-db.php on line 1657Hi @rwall
I’ve just noticed that this problem was fixed by the great people at WordPress in WP 4.9.3
from the Summary at https://codex.ww.wp.xz.cn/Version_4.9.3
WPDB
#43109 – Use a PCRE syntax which supports PCRE compiled between 2003 and 2006.Easily have not updated the PCRE for our account, i.e. it is still PCRE Library Version 6.6 06-Feb-2006. Nonetheless, curtc.net is now running WP 4.9.4 (unmodified) without generating the ‘preg_match(): Compilation failed…’ message
Forum: Fixing WordPress
In reply to: preg_match(): Compilation failed at wp-db.php on line 1657@rcwall
Pioneer Web Design: Welcome back, though I don’t follow what you are saying.Anyway, while doing some digging into the specific problem raised by the OP, I came across this:
Example #4 on http://php.net/manual/en/function.preg-match.php
Apologies for the no doubt incorrect formatting<?php $str = 'foobar: 2008'; preg_match('/(?P<name>\w+): (?P<digit>\d+)/', $str, $matches); /* This also works in PHP 5.2.2 (PCRE 7.0) and later, however * the above form is recommended for backwards compatibility */ // preg_match('/(?<name>\w+): (?<digit>\d+)/', $str, $matches); print_r($matches); ?>The wp-db.php file from WP 4.9 uses the syntax ?< rather than ?P< in lines relevant to line 1657.
See below, my highlighting, snippet ends at line 1657.* @since 4.9.0 * * @param string $host The DB_HOST setting to parse. * @return array|bool Array containing the host, the port, the socket and whether * it is an IPv6 address, in that order. If $host couldn't be parsed, * returns false. */ public function parse_db_host( $host ) { $port = null; $socket = null; $is_ipv6 = false; // We need to check for an IPv6 address first. // An IPv6 address will always contain at least two colons. if ( substr_count( $host, ':' ) > 1 ) { <strong>$pattern = '#^(?:\[)?(?<host>[0-9a-fA-F:]+)(?:\]:(?<port></strong>[\d]+))?(?:/(?<socket>.+))?#'; $is_ipv6 = true; } else { // We seem to be dealing with an IPv4 address. <strong>$pattern = '#^(?<host>[^:/]*)(?::(?<port>[\d]+))?(?::(?<socket>.+))?#';</strong> } $matches = array(); $result = preg_match( $pattern, $host, $matches );Adding the P i,e changing ?< to ?P< in the highlighted lines in the WP 4.9 version of wp-db.php and reloading manually WP 4.9 (with modified wp-db.php) on my site (curtc.net hosted by Easily) causes the Warning highlighted by the OP to go away… As far as I can tell the site is fully functional.
Of course this is not conclusive as Easily could have updated their php version by now.
Please note, I’m no php expert but this has worked for me. But please proceed at your own risk and frankly I don’t recommend it.
Again, thanks to those who have helped with the problem highlighted by the OP.
Edit Highlighting in the 2nd code box appears as the code for bold and end code for bold, i.e. the lines containing $pattern
Forum: Fixing WordPress
In reply to: preg_match(): Compilation failed at wp-db.php on line 1657Forum: Fixing WordPress
In reply to: preg_match(): Compilation failed at wp-db.php on line 1657@rwall
I updated a site not hosted by Easily to WP 4.9…. no problem, no warnings. The other thing I noted is that all the results from the Google search you suggest contain …./web1/userxxxxx/website/… where the x’s are numbers (4 or 5). This format is the one used by Easily for hosting (my other sites use a different format). So it suggests (but not conclusively) that the websites suffering from this warning after the upgrade to WP 4.9 are from a particular host which brings me back to thinking it is a php version issue.
I suggest we turn our attention to our host!Forum: Fixing WordPress
In reply to: preg_match(): Compilation failed at wp-db.php on line 1657@rwall
I’m not drt102. The site with which I have had the problems is hosted by Easily.co.uk! The other sites are hosted elsewhere so I’ll try an upgrade to WP 4.9 and see what happens.
Thanks for the heads-up about the other instances.Forum: Fixing WordPress
In reply to: preg_match(): Compilation failed at wp-db.php on line 1657@rwall
Thanks for the reply. I run and moderate a couple of websites and fully appreciate your comments. While not chartered I too am an Engineer and know what PHP is but little more.
To reiterate, upgrading to WP 4.9 broke (or at least severely impaired) one of the websites I look after. (I have not updated any of the other websites to WP 4.9.) In search of help, I ended up in this thread where you appear to have experienced the same problem, i.e. the warning with the reference to line 1657 in wp-db.php.
I (like you) have now downgraded back to WP 4.8.3 on the site I had upgraded to WP 4.9. The website is now working fine again.Forum: Fixing WordPress
In reply to: preg_match(): Compilation failed at wp-db.php on line 1657Forum: Fixing WordPress
In reply to: preg_match(): Compilation failed at wp-db.php on line 1657Have gone back to 4.8.3 by replacing wp-admin and wp-includes directories along with wp-settings.php with the 4.8.3 equivalents. curtc.net now loads without warnings…
Forum: Fixing WordPress
In reply to: preg_match(): Compilation failed at wp-db.php on line 1657@swansonphotos The complete error message I’m getting on a desktop browser for http://www.curtc.net is
Warning: preg_match(): Compilation failed: unrecognized character after (?< at offset 4 in /web1/userxxxxx/website/wp/wp-includes/wp-db.php on line 1657Warning: Cannot modify header information – headers already sent by (output started at /web1/userxxxxx/website/wp/wp-includes/wp-db.php:1657) in /web1/userxxxxxx/website/wp/wp-content/plugins/sign-up-sheets-pro/lib/dls-session.php on line 105
xxxxx=user numberThe second part varies in a way I don’t understand. For example on loading the login page I get
Warning: preg_match(): Compilation failed: unrecognized character after (?< at offset 4 in /web1/userxxxxxx/website/wp/wp-includes/wp-db.php on line 1657
Warning: Cannot modify header information – headers already sent by (output started at /web1/userxxxxx/website/wp/wp-includes/wp-db.php:1657) in /web1/userxxxxxx/website/wp/wp-includes/pluggable.php on line 1216
The
Warning: preg_match(): Compilation failed: unrecognized character after (?< at offset 4 in /web1/userxxxxxx/website/wp/wp-includes/wp-db.php on line 1657
appears common to all these error messages.The relevant code in wp-db.php is (ending in line 1657)
* @since 4.9.0
*
* @param string $host The DB_HOST setting to parse.
* @return array|bool Array containing the host, the port, the socket and whether
* it is an IPv6 address, in that order. If $host couldn’t be parsed,
* returns false.
*/
public function parse_db_host( $host ) {
$port = null;
$socket = null;
$is_ipv6 = false;// We need to check for an IPv6 address first.
// An IPv6 address will always contain at least two colons.
if ( substr_count( $host, ‘:’ ) > 1 ) {
$pattern = ‘#^(?:\[)?(?<host>[0-9a-fA-F:]+)(?:\]:(?<port>[\d]+))?(?:/(?<socket>.+))?#’;
$is_ipv6 = true;
} else {
// We seem to be dealing with an IPv4 address.
$pattern = ‘#^(?<host>[^:/]*)(?::(?<port>[\d]+))?(?::(?<socket>.+))?#’;
}$matches = array();
$result = preg_match( $pattern, $host, $matches );Forum: Fixing WordPress
In reply to: preg_match(): Compilation failed at wp-db.php on line 1657Hi @rwall, Thanks for the update. I’m no pHp expert either! But just looking at the syntax of the infamous preg_match statement in the infamous line 1657, it is rather different to the preg_mayvh statements in the corresponding file in 4.8.3 (and indeed the other preg_match statements in the 4.9.0 file).
However if it is simply a version issue, I would have thought they would be more folks having the same problem. I will find some time to try a few things next week (hopefully)Forum: Fixing WordPress
In reply to: preg_match(): Compilation failed at wp-db.php on line 1657Hi, I too am seeing this error on http://www.curtc.net. The site loads but the error message referring to line 1657 in wp-db.php appears at the top. However it is no longer possible to reach the login page for the site (which of course is a but of a pain). This did not happen with 4.8.3 and I will downgrade back to 4.8.3.
Looking at line 1657 in wp-db.php, there is indeed a preg_match statement which is part of a new bit of code (since 4.9.0) that parses the db_host. Could this be a php version issue?
My $0.02
Christie
ps Many thanks to all behind WordPress, its development and this forum. I’d be truly (deleted) without you all.Forum: Plugins
In reply to: [jQuery T(-) Countdown Widget] IE11 problemHi Baden
I loaded up 2.3.3a and it shows as such on my Dashboard. However, the appearance of the c-3po counter has not changed in IE11. Everything ok in Chrome and counters counting in both browsers.
Thanks again for all your efforts
crkmForum: Plugins
In reply to: [jQuery T(-) Countdown Widget] IE11 problemMany thanks!
Best
crkmForum: Plugins
In reply to: [jQuery T(-) Countdown Widget] IE11 problemHi Baden
I’m no expert but IE not coping with the excellent styling of the c-3po theme would seem to be the problem.
Happy Easter
CrkmForum: Plugins
In reply to: [jQuery T(-) Countdown Widget] IE11 problemHi Baden
2015-05-10 14:00:00. I’m using the sidebar widget. The countdown is working in chrome, firefox and IE. The appearance is the problem. In IE you don’t see the same shading (using c-3po) and you cannot read the labels for days, hours, etc. I’ve added a second timer (2015-09-20 10:30:00 using carbonite-responsive, also checked jedi) which looks ok in chrome and IE. So maybe it is related to the c-3po theme?
Many thanks