Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to resolve the open_basedir restriction in effect error in WordPress.
- WordPress site suddenly started getting this error on administrative pages.
- Warning: file_exists(): open_basedir restriction in effect. File(core/post-comments) is not within the allowed path(s): (/data/web/virtuals/269369/virtual) in /data/web/virtuals/269369/virtual/www/domains/mfproductions.cz/wp-includes/blocks.php on line 532
- This solution involves modifying the wp-includes/blocks.php file temporarily to bypass the issue.
- php
- // Original code in wp-includes/blocks.php on line 532
- if (is_string( $block_type ) && file_exists( $block_type ) ) {
- // Updated code to fix the open_basedir restriction issue
- if ($block_type != "core/post-comments" && is_string( $block_type ) && file_exists( $block_type ) ) {
- Steps to Apply the Fix:
- Locate the File: Navigate to wp-includes/blocks.php in your WordPress installation.
- Edit the File: Find line 532 and replace:
- php
- if (is_string( $block_type ) && file_exists( $block_type ) ) {
- with:
- php
- if ($block_type != "core/post-comments" && is_string( $block_type ) && file_exists( $block_type ) ) {
- Save Changes: Save and upload the modified file back to your server.
- Update WordPress: After applying this fix, update all plugins and WordPress core to ensure compatibility.
- Revert Changes: Once everything is updated and working, revert the change in blocks.php for a cleaner setup.
Advertisement
Add Comment
Please, Sign In to add comment