Open_basedir restriction in effect (tried everything)

After migrating to my shared hosting, I’m banging my head with this one.
I can’t even trace what’s exactly causing it (Acorn).

Warning: is_readable(): open_basedir restriction in effect.
File(/home/name/domains) is not within the allowed path(s): (/home/name/domains/domain.com:/tmp:/var/tmp:/home/name/.tmp:/home/name/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/name/domains/domain.com/public_html/wp-content/themes/koalicja/vendor/illuminate/filesystem/Filesystem.php on line 524

What I’ve tried so far:

  1. GPTing a living s**t out of this errors.
  2. Clean wordpress instance without my db and stuff.
  3. Removing file by file - this exact error is disappearing with function.php and the rest of the site :wink:

This is my working repo if anyone want to check it.

I’ve dealt with this issue recently as well on a website hosted on shared hosting (which isn’t recommended by Roots, but needs must and all that). I believe the issue stems from the latest version of Acorn (4.2.2).

Whitelisting open_basedir paths by the webhoster didn’t resolve things (or they didn’t do it correctly, but I wasn’t able to verify. The only thing that worked was disabling open_basedir entirely in php.ini.

As the webhoster wasn’t willing to disable citing security issues, I downgraded Acorn to the 3.* branch, which is working, but doesn’t seem like a future-proof solution.

My webhoster is not willing to make any changes in php.ini and whitelisting it in .htaccess or wp-config is doing nothing.

@alwaysblank @ben @csorrentino @QWp6t is this going to be future feature of Acorn? Why is it need to probe outside domain?

This modification to Filesystem.php in Illuminate gave me somewhat solution. I got several different errors but cannot confirm if they are connected:

public function isReadable($path)
{
    $allowedPaths = ['/home/name/domains/domain.com', '/tmp', '/var/tmp', '/home/name/.tmp', '/home/name/.php', '/usr/local/php', '/opt/alt', '/etc/pki'];

    foreach ($allowedPaths as $allowedPath) {
        if (strpos($path, $allowedPath) === 0) {
            return is_readable($path);
        }
    }

    return false;
}

Yes, the webhoster I was dealing with wouldn’t turn it off either, despite the questionable security benefits of open_basedir (or at least that’s what I read about it and many hosters seem to have the setting turned off).

It might be worth it to file a bug report over at the Acorn Git repo, as it seems strange that higher level access would be needed. Or maybe the documentation could be upgraded to reflect the need for open_basedir to be turned off.

Can you try upgrading Acorn? :slight_smile:

To the 5.0.0-alpha.0 version?

The issue occurred with the 4.2.2 release for me, but I see @l_dudzic’s repository is at 4.0.2.

1 Like

Upgrading to ^5.0.0 alpha didn’t help. Same error.

I’ve monkey patched it with:

vendor/illuminate/filesystem/Filesystem.php

 * Determine if the given path is readable.
 *
 * @param  string  $path
 * @return bool
 */
public function isReadable($path)
{
    // Ensure the path is within the allowed directories
    $allowedPaths = [
        '/home/domain/domains/domain.com',
        '/tmp',
        '/var/tmp',
        '/home/domain/.tmp',
        '/home/domain/.php',
        '/usr/local/php',
        '/opt/alt',
        '/etc/pki'
    ];

    foreach ($allowedPaths as $allowedPath) {
        if (strpos($path, $allowedPath) === 0) {
            return is_readable($path);
        }
    }

    return false;
}

Patching it in the Illuminate Filesystem class is most certainly not a good fix. Filesystem it’s self is not the issue.

You need to look deeper in the stack trace and find where the Filesystem class is actually being used within Acorn its self to be causing this.

If you find a proper trace, please feel free to open an issue on the Acorn repo.

I’ve upgraded Acorn from 3.3.1 to 4.2.2 on the hosting that was giving me trouble earlier, but I can’t seem to reproduce the error anymore.

The only files and folders I replaced were composer.json, composer.lock and vendor. So either the composer update rejigged things, or the hoster has silently changed their server configuration.

1 Like

That’s the main problem here. I can’t trace it further than Filesystem :frowning:

Here is me debug log. I can’t tell if something useful is in there:

debug log

[20-May-2024 01:29:07 UTC] PHP Fatal error Uncaught Error: Call to undefined function mysqli_report() in /home/user/domains/domain.com/public_html/sub_domain/wp-includes/class-wpdb.php:1963

Stack trace:

#0 /home/user/domains/domain.com/public_html/sub_domain/wp-includes/class-wpdb.php(767): wpdb->db_connect()
#1 /home/user/domains/domain.com/public_html/sub_domain/wp-includes/load.php(683): wpdb->__construct()
#2 /home/user/domains/domain.com/public_html/sub_domain/wp-settings.php(124): require_wp_db()
#3 /home/user/domains/domain.com/public_html/sub_domain/wp-config.php(101): require_once('/home/user/d...')
#4 /home/user/domains/domain.com/public_html/sub_domain/wp-load.php(50): require_once('/home/user/d...')
#5 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/admin.php(34): require_once('/home/user/d...')
#6 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/themes.php(10): require_once('/home/user/d...')
#7 {main}
thrown in /home/user/domains/domain.com/public_html/sub_domain/wp-includes/class-wpdb.php on line 1963

[20-May-2024 01:29:09 UTC] PHP Fatal error Uncaught Error: Call to undefined function mysqli_report() in /home/user/domains/domain.com/public_html/sub_domain/wp-includes/class-wpdb.php:1963

Stack trace:

#0 /home/user/domains/domain.com/public_html/sub_domain/wp-includes/class-wpdb.php(767): wpdb->db_connect()
#1 /home/user/domains/domain.com/public_html/sub_domain/wp-includes/load.php(683): wpdb->__construct()
#2 /home/user/domains/domain.com/public_html/sub_domain/wp-settings.php(124): require_wp_db()
#3 /home/user/domains/domain.com/public_html/sub_domain/wp-config.php(101): require_once('/home/user/d...')
#4 /home/user/domains/domain.com/public_html/sub_domain/wp-load.php(50): require_once('/home/user/d...')
#5 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/admin.php(34): require_once('/home/user/d...')
#6 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/themes.php(10): require_once('/home/user/d...')
#7 {main}
thrown in /home/user/domains/domain.com/public_html/sub_domain/wp-includes/class-wpdb.php on line 1963

[20-May-2024 01:40:59 UTC] PHP Warning require(/home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): Failed to open stream: No such file or directory in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php on line 41

[20-May-2024 01:40:59 UTC] PHP Fatal error Uncaught Error: Failed opening required '/home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php' (include_path='.:/opt/alt/php82/usr/share/pear:/opt/alt/php82/usr/share/php:/usr/share/pear:/usr/share/php') in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php:41

Stack trace:

#0 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php(45): {closure}()
#1 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/autoload.php(25): ComposerAutoloaderInit52d53e79660202dce1b27c2712b9cdb6::getLoader()
#2 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/functions.php(18): require('/home/user/d...')
#3 /home/user/domains/domain.com/public_html/sub_domain/wp-settings.php(611): include('/home/user/d...')
#4 /home/user/domains/domain.com/public_html/sub_domain/wp-config.php(101): require_once('/home/user/d...')
#5 /home/user/domains/domain.com/public_html/sub_domain/wp-load.php(50): require_once('/home/user/d...')
#6 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/admin.php(34): require_once('/home/user/d...')
#7 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/customize.php(13): require_once('/home/user/d...')
#8 {main}
thrown in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php on line 41

[20-May-2024 01:40:59 UTC] PHP Warning Trying to access array offset on value of type bool in /home/user/domains/domain.com/public_html/sub_domain/wp-includes/class-wp-recovery-mode-email-service.php on line 367

[20-May-2024 01:40:59 UTC] PHP Warning Trying to access array offset on value of type bool in /home/user/domains/domain.com/public_html/sub_domain/wp-includes/class-wp-recovery-mode-email-service.php on line 368

[20-May-2024 01:41:17 UTC] PHP Warning require(/home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): Failed to open stream: No such file or directory in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php on line 41

[20-May-2024 01:41:17 UTC] PHP Fatal error Uncaught Error: Failed opening required '/home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php' (include_path='.:/opt/alt/php82/usr/share/pear:/opt/alt/php82/usr/share/php:/usr/share/pear:/usr/share/php') in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php:41

Stack trace:

#0 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php(45): {closure}()
#1 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/autoload.php(25): ComposerAutoloaderInit52d53e79660202dce1b27c2712b9cdb6::getLoader()
#2 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/functions.php(18): require('/home/user/d...')
#3 /home/user/domains/domain.com/public_html/sub_domain/wp-settings.php(611): include('/home/user/d...')
#4 /home/user/domains/domain.com/public_html/sub_domain/wp-config.php(101): require_once('/home/user/d...')
#5 /home/user/domains/domain.com/public_html/sub_domain/wp-load.php(50): require_once('/home/user/d...')
#6 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/admin.php(34): require_once('/home/user/d...')
#7 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/customize.php(13): require_once('/home/user/d...')
#8 {main}
thrown in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php on line 41

[20-May-2024 01:41:19 UTC] PHP Warning require(/home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): Failed to open stream: No such file or directory in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php on line 41

[20-May-2024 01:41:19 UTC] PHP Fatal error Uncaught Error: Failed opening required '/home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php' (include_path='.:/opt/alt/php82/usr/share/pear:/opt/alt/php82/usr/share/php:/usr/share/pear:/usr/share/php') in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php:41

Stack trace:

#0 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php(45): {closure}()
#1 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/autoload.php(25): ComposerAutoloaderInit52d53e79660202dce1b27c2712b9cdb6::getLoader()
#2 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/functions.php(18): require('/home/user/d...')
#3 /home/user/domains/domain.com/public_html/sub_domain/wp-settings.php(611): include('/home/user/d...')
#4 /home/user/domains/domain.com/public_html/sub_domain/wp-config.php(101): require_once('/home/user/d...')
#5 /home/user/domains/domain.com/public_html/sub_domain/wp-load.php(50): require_once('/home/user/d...')
#6 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/admin.php(34): require_once('/home/user/d...')
#7 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/customize.php(13): require_once('/home/user/d...')
#8 {main}
thrown in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php on line 41

[20-May-2024 01:41:22 UTC] PHP Warning require(/home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): Failed to open stream: No such file or directory in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php on line 41

[20-May-2024 01:41:22 UTC] PHP Fatal error Uncaught Error: Failed opening required '/home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php' (include_path='.:/opt/alt/php82/usr/share/pear:/opt/alt/php82/usr/share/php:/usr/share/pear:/usr/share/php') in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php:41

Stack trace:

#0 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php(45): {closure}()
#1 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/autoload.php(25): ComposerAutoloaderInit52d53e79660202dce1b27c2712b9cdb6::getLoader()
#2 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/functions.php(18): require('/home/user/d...')
#3 /home/user/domains/domain.com/public_html/sub_domain/wp-settings.php(611): include('/home/user/d...')
#4 /home/user/domains/domain.com/public_html/sub_domain/wp-config.php(101): require_once('/home/user/d...')
#5 /home/user/domains/domain.com/public_html/sub_domain/wp-load.php(50): require_once('/home/user/d...')
#6 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/admin.php(34): require_once('/home/user/d...')
#7 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/customize.php(13): require_once('/home/user/d...')
#8 {main}
thrown in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php on line 41

[20-May-2024 01:41:22 UTC] PHP Warning require(/home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): Failed to open stream: No such file or directory in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php on line 41

[20-May-2024 01:41:22 UTC] PHP Fatal error Uncaught Error: Failed opening required '/home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php' (include_path='.:/opt/alt/php82/usr/share/pear:/opt/alt/php82/usr/share/php:/usr/share/pear:/usr/share/php') in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php:41

Stack trace:

#0 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php(45): {closure}()
#1 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/autoload.php(25): ComposerAutoloaderInit52d53e79660202dce1b27c2712b9cdb6::getLoader()
#2 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/functions.php(18): require('/home/user/d...')
#3 /home/user/domains/domain.com/public_html/sub_domain/wp-settings.php(611): include('/home/user/d...')
#4 /home/user/domains/domain.com/public_html/sub_domain/wp-config.php(101): require_once('/home/user/d...')
#5 /home/user/domains/domain.com/public_html/sub_domain/wp-load.php(50): require_once('/home/user/d...')
#6 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/admin.php(34): require_once('/home/user/d...')
#7 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/customize.php(13): require_once('/home/user/d...')
#8 {main}
thrown in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php on line 41

[20-May-2024 01:41:23 UTC] PHP Warning require(/home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): Failed to open stream: No such file or directory in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php on line 41

[20-May-2024 01:41:23 UTC] PHP Fatal error Uncaught Error: Failed opening required '/home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php' (include_path='.:/opt/alt/php82/usr/share/pear:/opt/alt/php82/usr/share/php:/usr/share/pear:/usr/share/php') in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php:41

Stack trace:

#0 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php(45): {closure}()
#1 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/autoload.php(25): ComposerAutoloaderInit52d53e79660202dce1b27c2712b9cdb6::getLoader()
#2 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/functions.php(18): require('/home/user/d...')
#3 /home/user/domains/domain.com/public_html/sub_domain/wp-settings.php(611): include('/home/user/d...')
#4 /home/user/domains/domain.com/public_html/sub_domain/wp-config.php(101): require_once('/home/user/d...')
#5 /home/user/domains/domain.com/public_html/sub_domain/wp-load.php(50): require_once('/home/user/d...')
#6 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/admin.php(34): require_once('/home/user/d...')
#7 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/customize.php(13): require_once('/home/user/d...')
#8 {main}
thrown in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php on line 41

[20-May-2024 01:41:33 UTC] PHP Warning require(/home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): Failed to open stream: No such file or directory in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php on line 41

[20-May-2024 01:41:33 UTC] PHP Fatal error Uncaught Error: Failed opening required '/home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php' (include_path='.:/opt/alt/php82/usr/share/pear:/opt/alt/php82/usr/share/php:/usr/share/pear:/usr/share/php') in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php:41

Stack trace:

#0 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php(45): {closure}()
#1 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/autoload.php(25): ComposerAutoloaderInit52d53e79660202dce1b27c2712b9cdb6::getLoader()
#2 /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/functions.php(18): require('/home/user/d...')
#3 /home/user/domains/domain.com/public_html/sub_domain/wp-settings.php(611): include('/home/user/d...')
#4 /home/user/domains/domain.com/public_html/sub_domain/wp-config.php(101): require_once('/home/user/d...')
#5 /home/user/domains/domain.com/public_html/sub_domain/wp-load.php(50): require_once('/home/user/d...')
#6 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/admin.php(34): require_once('/home/user/d...')
#7 /home/user/domains/domain.com/public_html/sub_domain/wp-admin/customize.php(13): require_once('/home/user/d...')
#8 {main}
thrown in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/composer/autoload_real.php on line 41

[20-May-2024 04:32:25 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 04:32:43 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 04:32:54 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 04:33:03 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 04:33:06 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 04:33:08 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524


[20-May-2024 04:42:38 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 04:49:07 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 04:49:14 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 04:50:49 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 04:50:51 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 04:51:04 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 04:54:59 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 04:55:01 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 04:55:37 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 04:55:54 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 04:57:41 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 05:00:25 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 05:00:28 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_theme/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 05:34:05 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_themez/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 06:01:53 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_themez/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 06:14:55 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_themez/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 07:32:09 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_themez/vendor/illuminate/filesystem/Filesystem.php on line 524

[20-May-2024 07:38:08 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_themez/vendor/illuminate/filesystem/Filesystem.php on line 523

[20-May-2024 07:38:50 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_themez/vendor/illuminate/filesystem/Filesystem.php on line 523

[20-May-2024 07:41:21 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_themez/vendor/illuminate/filesystem/Filesystem.php on line 523

[20-May-2024 07:46:00 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_themez/vendor/illuminate/filesystem/Filesystem.php on line 523

[20-May-2024 07:46:03 UTC] PHP Warning is_readable(): open_basedir restriction in effect. File(/home/user/domains) is not within the allowed path(s): (/home/user/domains/domain.com:/tmp:/var/tmp:/home/user/.tmp:/home/user/.php:/usr/local/php:/opt/alt:/etc/pki) in /home/user/domains/domain.com/public_html/sub_domain/wp-content/themes/my_themez/vendor/illuminate/filesystem/Filesystem.php on line 523```

I fixed temporarily by changing the following file:
/vendor/roots/acorn/src/Roots/Acorn/Filesystem/Filesystem.php line 32

        // -- while ($this->isReadable($currentDirectory)) {
        while ($currentDirectory !== '/home' && $this->isReadable($currentDirectory)) {

There is a closest method that inspects every folder.

I just opened an issue so it’s taken care of: open_basedir php warning restriction with shared hostings due to "closest" method · Issue #380 · roots/acorn · GitHub

2 Likes