Make WordPress Core

Opened 15 months ago

Last modified 15 months ago

#57237 new defect (bug)

file_exists(): open_basedir restriction in effect. File(core/post-comments) is not within the allowed path(s)

Reported by: davidki's profile davidki Owned by:
Milestone: Awaiting Review Priority: normal
Severity: critical Version:
Component: Editor Keywords: dev-feedback
Focuses: Cc:

Description (last modified by costdev)

Hello,

After updating wordpress to version 6.1.1 I see this php warning messages:

Warning: file_exists(): open_basedir restriction in effect. File(core/post-comments) is not within the allowed path(s): (/data/web/virtuals/291601/virtual) in /data/web/virtuals/291601/virtual/www/wp-includes/blocks.php on line 532

Warning: Cannot modify header information - headers already sent by (output started at /data/web/virtuals/291601/virtual/www/wp-includes/blocks.php:532) in /data/web/virtuals/291601/virtual/www/wp-includes/pluggable.php on line 1416

Warning: Cannot modify header information - headers already sent by (output started at /data/web/virtuals/291601/virtual/www/wp-includes/blocks.php:532) in /data/web/virtuals/291601/virtual/www/wp-includes/pluggable.php on line 1419

I can't get into admin. I use php 8.1.11.

I try to rename all plugins via FTP, but nothing change.

On my another testing website I see the same php warning messages, but I can reach the wordpress administration. So I tryed to disable all plugins and change theme to default "Twenty Twenty-Two" but nothing change.

I am not the only one who suffer with these errors. Here for examle:
https://stackoverflow.com/questions/74327979/wp-error-warning-file-exists-open-basedir-restriction-in-effect-filecore

Thank you,

David

Change History (3)

#1 @costdev
15 months ago

  • Keywords dev-feedback added

Hi @davidki, welcome to Trac!

It seems that the file_exists() check here does not take into consideration that a block name like core/post-comments will produce a check on the root of the filesystem, which, as we see here, causes warnings when the open_basedir PHP directive has been set.

We're trying to avoid using the error suppression operator @ as much as possible. However, this may be a suitable situation for it.

@SergeyBiryukov Do you have any thoughts on this?

#2 @costdev
15 months ago

  • Component changed from General to Editor

#3 @costdev
15 months ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.