Title: Error for PHP 8.1
Last modified: March 9, 2023

---

# Error for PHP 8.1

 *  Resolved [nutttaro](https://wordpress.org/support/users/nutttaro/)
 * (@nutttaro)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/error-for-php-8-1-2/)
 * Hello there,
 * I got an error on PHP 8.1, please see the error message blow.
 *     ```wp-block-code
       [09-Mar-2023 03:02:42 UTC] PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/wp-content/plugins/better-wp-security/core/core.php on line 1102
       ```
   

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

 *  [Shalom Taiwo](https://wordpress.org/support/users/shalomt/)
 * (@shalomt)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/error-for-php-8-1-2/#post-16542354)
 * Hi there,
   Thank you for reaching out. ITSec is still in preliminary support for
   8.1, so there may still be some warnings and deprecation notices, but it should
   not halt the plugin’s functionality.Rest assured, we are aware of these PHP warnings,
   and we’re working on this. Thank you for your patience, and I’ll go ahead and
   mark this post resolved.
 *  [pohadkozem](https://wordpress.org/support/users/pohadkozem/)
 * (@pohadkozem)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/error-for-php-8-1-2/#post-16734652)
 *     ```wp-block-code
       if (is_string($home_path) && $home_path !== null) { 
          $home_path = trim($home_path, '/'); 
       }
       ```
   
 *  [japsen](https://wordpress.org/support/users/japsen/)
 * (@japsen)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/error-for-php-8-1-2/#post-17033326)
 * Is there any ETA on when this issue will be resolved?
 *  [David Navia](https://wordpress.org/support/users/davidnaviaweb/)
 * (@davidnaviaweb)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/error-for-php-8-1-2/#post-17107024)
 * Hi you all!
 * Still no fix for this? I know is a minor thing, and that is what surprises me
   the most. More than seven months to fix this? I suggest to change line 1102 for:
 *     ```wp-block-code
       $home_path = trim( $home_path ?? '', '/' );
       ```
   
 * Regards

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

The topic ‘Error for PHP 8.1’ is closed to new replies.

 * ![](https://ps.w.org/better-wp-security/assets/icon.svg?rev=3529351)
 * [Kadence Security – Password, Two Factor Authentication, and Brute Force Protection](https://wordpress.org/plugins/better-wp-security/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/better-wp-security/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/better-wp-security/)
 * [Active Topics](https://wordpress.org/support/plugin/better-wp-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/better-wp-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/better-wp-security/reviews/)

 * 5 replies
 * 5 participants
 * Last reply from: [David Navia](https://wordpress.org/support/users/davidnaviaweb/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/error-for-php-8-1-2/#post-17107024)
 * Status: resolved