Title: PHP Warnings in Error Log
Last modified: August 21, 2016

---

# PHP Warnings in Error Log

 *  [awhig](https://wordpress.org/support/users/awhig/)
 * (@awhig)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/php-warnings-in-error-log/)
 * Hi,
 * I’m using the latest version of the plugin with WP 3.6.1. I’m finding these errors
   in my error log.
 * [24-Oct-2013 05:21:40 UTC] PHP Warning: preg_match() [[function.preg-match](https://wordpress.org/support/topic/php-warnings-in-error-log/function.preg-match?output_format=md)]:
   Compilation failed: invalid UTF-8 string at offset 0 in [….]/plugins/antispam-
   bee/antispam_bee.php on line 1455
 * How can this be fixed?
 * Thank you,
    Rich
 * [http://wordpress.org/plugins/antispam-bee/](http://wordpress.org/plugins/antispam-bee/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [awhig](https://wordpress.org/support/users/awhig/)
 * (@awhig)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/php-warnings-in-error-log/#post-4252460)
 * FYI,
 * I’m using PHP 5.3.27.
 * Rich
 *  [Simon](https://wordpress.org/support/users/sdellenb/)
 * (@sdellenb)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/php-warnings-in-error-log/#post-4252738)
 * Did you modify any of the regex patterns on line 1399 of antispam_bee.php? Then‘
   $regexp’ could have an invalid value.
    Or it could be that a spam bot put invalid
   stuff into the comment field and then ‘$comment[$field]’ contains garbage.
 * I don’t see how that could enter “invalid UTF-8 strings” however..
 *  Thread Starter [awhig](https://wordpress.org/support/users/awhig/)
 * (@awhig)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/php-warnings-in-error-log/#post-4252747)
 * I have not modified any patterns.
 * I believe it is spam bots posting garbage comments.
 * I’ve done research and it looks like the solution is to remove or replace invalid
   UTF-8 characters in the data before processing.
 * I’m not sure if you see this as a WP responsibility or antispam-bee’s.
 * Here is a discussion that has tons of links in regards to this.
 * [http://stackoverflow.com/questions/1401317/remove-non-utf8-characters-from-string](http://stackoverflow.com/questions/1401317/remove-non-utf8-characters-from-string)
 * All I know is my error log is full of these, as my sites gets thousands of spam
   messages a day.
 * Thanks,
    Rich
 *  Thread Starter [awhig](https://wordpress.org/support/users/awhig/)
 * (@awhig)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-warnings-in-error-log/#post-4252763)
 * Hi,
 * Was this fixed in the latest release? I saw a comment in the change log that 
   seemed related?
 * If it was fixed, thanks for the update. Much appreciated.
 * Rich
 *  Thread Starter [awhig](https://wordpress.org/support/users/awhig/)
 * (@awhig)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-warnings-in-error-log/#post-4252764)
 * I think this was added in the new version:
 * /* Ignore non utf-8 chars */
    $comment[$field] = ( function_exists(‘iconv’) ?
   iconv(‘utf-8’, ‘utf-8//TRANSLIT’, $comment[$field]) : $comment[$field] );
 * Thanks,
    Rich
 *  Thread Starter [awhig](https://wordpress.org/support/users/awhig/)
 * (@awhig)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-warnings-in-error-log/#post-4252765)
 * FYI,
 * I’m still seeing the warning in my error_log with the latest version, but much,
   much, much less than before.
 * [16-Dec-2013 17:59:24 UTC] PHP Warning: preg_match() [[function.preg-match](https://wordpress.org/support/topic/php-warnings-in-error-log/function.preg-match?output_format=md)]:
   Compilation failed: invalid UTF-8 string at offset 1 in …./wp-content/plugins/
   antispam-bee/antispam_bee.php on line 1466
 * Thanks,
    Rich

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘PHP Warnings in Error Log’ is closed to new replies.

 * ![](https://ps.w.org/antispam-bee/assets/icon-256x256.png?rev=2898402)
 * [Antispam Bee](https://wordpress.org/plugins/antispam-bee/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/antispam-bee/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/antispam-bee/)
 * [Active Topics](https://wordpress.org/support/plugin/antispam-bee/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/antispam-bee/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/antispam-bee/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [awhig](https://wordpress.org/support/users/awhig/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/php-warnings-in-error-log/#post-4252765)
 * Status: not resolved