Title: PHP Warnings
Last modified: January 10, 2023

---

# PHP Warnings

 *  Resolved [dssunil](https://wordpress.org/support/users/dssunil/)
 * (@dssunil)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/php-warnings-149/)
 * Hi Team
   I’ve updated the php version 8.1 Now it throws warnings everywhere.
 * **Deprecated**: strstr(): Passing null to parameter #1 ($haystack) of type string
   is deprecated in**/public_html/wp-content/plugins/woocommerce/includes/wc-page-
   functions.php** on line **139**

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

 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/php-warnings-149/#post-16358230)
 * PHP8.1 came out on 25/11/21, so its unlikely this error is coming from WooCommerce,
   which is kept up-to-date. It may be coming from some other software which is 
   trying to use WooCommerce functions.
 * Have you carried out a conflict test. Switch to the Storefront theme and deactivate
   all plugins except WooCommerce. The site should work without error now? Reactivate
   one by one and check to try to identify the software element which is not 8.1
   compatible.
 *  [BDR Bros.](https://wordpress.org/support/users/bdrbros/)
 * (@bdrbros)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/php-warnings-149/#post-16359218)
 * [@lorro](https://wordpress.org/support/users/lorro/) [@dssunil](https://wordpress.org/support/users/dssunil/)
   this deprecated is known but still not fixed.
   [https://wordpress.org/support/topic/php-warnings-143/](https://wordpress.org/support/topic/php-warnings-143/)
 * [https://github.com/woocommerce/woocommerce/issues/33808](https://github.com/woocommerce/woocommerce/issues/33808)
    -  This reply was modified 3 years, 4 months ago by [BDR Bros.](https://wordpress.org/support/users/bdrbros/).
 *  [BDR Bros.](https://wordpress.org/support/users/bdrbros/)
 * (@bdrbros)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/php-warnings-149/#post-16359674)
 * [@dssunil](https://wordpress.org/support/users/dssunil/) you can try: Woocommerce-
   > Status -> Tools
   Clear all cache and transients. It helped me.**EDIT:**Unfortunately
   only for a moment
    -  This reply was modified 3 years, 4 months ago by [BDR Bros.](https://wordpress.org/support/users/bdrbros/).
 *  [Igor H](https://wordpress.org/support/users/ihereira/)
 * (@ihereira)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/php-warnings-149/#post-16366611)
 * Hi, [@dssunil](https://wordpress.org/support/users/dssunil/)
 * To help you investigate this further, please share a copy of your site’s **System
   Status**: It is under **WooCommerce > Status**. Select “Get system report” and
   then “Copy for support”. 
 * Since the issue is reported in [GitHub](https://github.com/woocommerce/woocommerce/issues/33808)
   I recommend subscribing to the GitHub thread so that you can receive updates 
   when there is progress.
 * Hi, [@bdrbros](https://wordpress.org/support/users/bdrbros/)
 * For better assistance, you can create your own thread for your issue, right [here](https://wordpress.org/support/plugin/woocommerce/#new-topic-0).
 * Thank you.
 *  [jkkenzie](https://wordpress.org/support/users/jkkenzie/)
 * (@jkkenzie)
 * [3 years ago](https://wordpress.org/support/topic/php-warnings-149/#post-16791373)
 * Note that below is temporary solution because if you update woocommerce, the 
   change will be replaced (but hoping thew updates from woocommerce would solve
   the problem)
   First backup this file so that you can replace it if there is a 
   problem later:Edit line 139 of that file with error as follows:
 *     ```wp-block-code
       if ( strstr( isset($path)?$path:' ', $customer_logout ) || strstr( isset($query)?$query:'', $customer_logout ) ) {
        unset( $items[ $key ] );
       }
       ```
   
 * Just replace strstr( $path, $customer_logout ) with strstr( isset($path)?$path:’‘,
   $customer_logout ) 
   andreplace strstr( $query, $customer_logout ) with strstr(
   isset($query)?$query:”, $customer_logout )
 *  [seopie](https://wordpress.org/support/users/seopie/)
 * (@seopie)
 * [3 years ago](https://wordpress.org/support/topic/php-warnings-149/#post-16799540)
 * [@jkkenzie](https://wordpress.org/support/users/jkkenzie/)
 * I’m no coder, but as this throws an error, I think you may mean replace line 
   139 with
 *     ```wp-block-code
       if ( strstr( isset($path)?$path:", $customer_logout ) || strstr( isset($query)?$query:", $customer_logout ) ) {
       ```
   
 *  [jkkenzie](https://wordpress.org/support/users/jkkenzie/)
 * (@jkkenzie)
 * [3 years ago](https://wordpress.org/support/topic/php-warnings-149/#post-16803199)
 * To Just avoid mistakes, because you are not a coder, copy this code and replace
   line 139
 *     ```wp-block-code
       if ( strstr( isset($path)?$path:'', $customer_logout ) || strstr( isset($query)?$query:'', $customer_logout ) ) {
       ```
   
 * I suspect you might have used double quote (“) instead of single quotes (”)
 * I am using this code right now in my project and this code stopped the error.
   my woocommerce version is Version 7.7.2… on php 8.1
    -  This reply was modified 3 years ago by [jkkenzie](https://wordpress.org/support/users/jkkenzie/).
    -  This reply was modified 3 years ago by [jkkenzie](https://wordpress.org/support/users/jkkenzie/).
 *  [seopie](https://wordpress.org/support/users/seopie/)
 * (@seopie)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/php-warnings-149/#post-16829135)
 * My (obvious) mistake. Thanks.

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

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

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 8 replies
 * 8 participants
 * Last reply from: [seopie](https://wordpress.org/support/users/seopie/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/php-warnings-149/#post-16829135)
 * Status: resolved