Make WordPress Core

Opened 13 months ago

Closed 12 months ago

Last modified 12 months ago

#59833 closed defect (bug) (invalid)

While we update wordpress version 6.4 getting php error

Reported by: ravimakwana68's profile ravimakwana68 Owned by:
Milestone: Priority: normal
Severity: major Version: 6.4
Component: Upgrade/Install Keywords: reporter-feedback close
Focuses: Cc:

Description

Hello, today we tried to update WordPress version 6.4 in PHP 7.4.33 version and got PHP error. The current WordPress version is not stable.

error details is: PHP Fatal error: Uncaught Error: Call to undefined function str_contains() in /public_html/wp-includes/load.php

Change History (7)

#1 follow-up: @SergeyBiryukov
13 months ago

  • Keywords reporter-feedback added

Hi there, welcome to WordPress Trac! Thanks for the report.

This was previously brought up in #59113, but could not be reproduced yet. WordPress has a polyfill for str_contains() in wp-includes/compat.php, and it should be loaded during the initialization process.

  1. Could you provide the steps to reproduce the issue on a clean install?
  2. Could you confirm that your wp-settings.php file has compat.php on line 34?

#2 @ravimakwana68
13 months ago

While we existing website upgrading version from 6.2.2 to 6.4 getting website down.

#3 in reply to: ↑ 1 @ravimakwana68
13 months ago

Replying to SergeyBiryukov:

Hi there, welcome to WordPress Trac! Thanks for the report.

This was previously brought up in #59113, but could not be reproduced yet. WordPress has a polyfill for str_contains() in wp-includes/compat.php, and it should be loaded during the initialization process.

  1. Could you provide the steps to reproduce the issue on a clean install?
  2. Could you confirm that your wp-settings.php file has compat.php on line 34?

While we existing website upgrading version from 6.2.2 to 6.4 getting the website down.

#4 @rajinsharwar
13 months ago

Hey @ravimakwana68, I couldn't replicate it as well. Not sure, but will adding a check like "wp_installing()" in the compat.php for the polyfill help in any case @SergeyBiryukov?

This ticket was mentioned in Slack in #core by jorbin. View the logs.


13 months ago

#6 @antonvlasenko
12 months ago

  • Keywords close added

Reproduction Report

Environment

  • WordPress: 6.2.2 -> 6.4.1
  • PHP: 7.3.33
  • Server: Apache/2.4.57 (Unix) PHP/7.3.33
  • Database: mysqli (Server: 5.7.43 / Client: Unavailable)
  • Browser: Safari 17.1 (macOS)
  • Theme: Twenty Twenty-Three
  • MU-Plugins: None activated

Actual Results

  • ❌ No error occurs.

Additional Notes

I cannot reproduce this issue with PHP 7.3.33 on a clean install of WordPress 6.2.2.

#7 @azaozz
12 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Cannot reproduce either. Seems this is an one-off error that may have been caused by a failed or update. There doesn't seem to be a possibility for the polyfill to be missing as compat.php (where the polifills are) is always required before everything else including load.php. See: https://core.trac.wordpress.org/browser/trunk/src/wp-settings.php#L33.

Closing as invalid. Please feel free to reopen with more info on how to reliably reproduce this.

Version 0, edited 12 months ago by azaozz (next)
Note: See TracTickets for help on using tickets.