Make WordPress Core

Opened 17 months ago

Closed 17 months ago

Last modified 17 months ago

#59300 closed defect (bug) (invalid)

Site Health Check causes PHP errors when WP_CONTENT_DIR . '/upgrade/' doesn't exist

Reported by: madtownlems's profile MadtownLems Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Site Health Keywords:
Focuses: Cc:

Description

My error logs are filling with the following errors:

disk_free_space(): No such file or directory

from class-wp-site-health.php, Line 1944 (WordPress 6.3.1)

(I saw a few other tickets around disk_free_space() and 6.3, but nothing specifically about this.)

Change History (3)

#1 @Michi91
17 months ago

  • Keywords reporter-feedback added

I cant reproduce the Problem.

<?php
$available_space = function_exists( 'disk_free_space' ) ? @disk_free_space( WP_CONTENT_DIR . '/upgrade/' ) : false;

The @ supresses errors, but this can be overwritten by using a custom error handler. https://www.php.net/manual/en/language.operators.errorcontrol.php

Are you using plugins or a special enviroment changes the logging / error handling behavior?

And does the error log show the error level? Like:
Warning:disk_free_space(): No such file or directory

Last edited 17 months ago by Michi91 (previous) (diff)

#2 @MadtownLems
17 months ago

  • Resolution set to invalid
  • Status changed from new to closed

Are you using plugins or a special enviroment changes the logging / error handling behavior?

Ah yes! My mistake. I do have a custom error logger established with set_error_handler(). Removing that makes this no longer be logged.

Thank you!

#3 @SergeyBiryukov
17 months ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted

Thanks for the follow-up!

Note: See TracTickets for help on using tickets.