0

Setup

  • Rocky Linux 9
  • PHP 8.1
  • MySQL 8
  • Wordpress 6.2

I am attempting to install Wordpress on a brand new server I opened. But I'm getting the following warnings/errors when I visit the install page:

[18-May-2023 01:26:09 UTC] PHP Warning: preg_replace(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in /var/www/html/wp-includes/class-wpdb.php on line 1535
[18-May-2023 01:26:09 UTC] PHP Warning: preg_split(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in /var/www/html/wp-includes/class-wpdb.php on line 1538
[18-May-2023 01:26:09 UTC] PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /var/www/html/wp-includes/class-wpdb.php:1540
Stack trace:
0 /var/www/html/wp-includes/option.php(199): wpdb->prepare()
1 /var/www/html/wp-includes/l10n.php(63): get_option()
2 /var/www/html/wp-includes/l10n.php(139): get_locale()
3 /var/www/html/wp-includes/l10n.php(868): determine_locale()
4 /var/www/html/wp-includes/class-wp-fatal-error-handler.php(47): load_default_textdomain()
5 [internal function]: WP_Fatal_Error_Handler->handle()
6 {main}
thrown in /var/www/html/wp-includes/class-wpdb.php on line 1540

After doing some error logging, I realized the fatal error is simply a result of the preg_replace() issue.

A similar question and other reading suggested that updating the libpcre2-8-0 package was the solve. I confirmed that package is on 10.40 and there are no pending updates I can install for any pcre package (On my system its called pcre2). According to this thats the latest version.

Is there anything I can do to fix this?

Josh Whitlow
  • 481
  • 6
  • 25
  • How did you downloaded and install Wordpress? – Koala Yeung May 18 '23 at 03:36
  • What repo did you install PHP from? I would raise this as an issue with their package maintainers. – Sammitch May 18 '23 at 05:28
  • Followed this guide to install WP: https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-centos-7 I used this repo: http://rpms.remirepo.net/enterprise/remi-release-9.rpm, will do – Josh Whitlow May 18 '23 at 14:18

0 Answers0