PHP Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s) – WordPress Error

If you encounter an error on your WordPress website:

PHP Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/admin/web/your.domain/public_html:/home/admin/tmp) in /home/admin/web/your.domain/public_html/wp-includes/functions.php on line 1366

Or a similar error, it doesn’t have to be functions.php file, it can be any file from WordPress core files then you have probably moved your website to another server.

You will find this error in your website’s error log, it will cause the website to return probably HTTP Error 500 Internal server error or 403 Forbidden error.

There’s a fix to this error. Go to phpMyAdmin and:

  1. Choose the wp_options table.
  2. Click Search, and enter “upload_path” in the “option_name” field.
  3. This should return one row with your old host’s path as the “option_value”. Double-click the value to edit, and change it to the path of the “uploads” folder at your new host (you should be able to figure it out via FTP or your host’s control panel).
Marcus Richardson
Editor-in-chief

I love testing and writing about new tech. I'm also a gamer and an engineer. Check out my Twitter for keyboard stuff.

1 thought on “PHP Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s) – WordPress Error”

  1. Warning: is_readable(): open_basedir restriction in effect. File(/Newspaper/theme.json) is not within the allowed path(s): (/home/lhrpkacw/:/tmp:/var/tmp:/opt/alt/php74/usr/share/pear/:/dev/urandom:/usr/local/lib/php/:/usr/local/php74/lib/php/) in /home/lhrpkacw/domains/qm.com.pk/public_html/thenews/wp-includes/class-wp-theme-json-resolver.php on line 433
    When installing mobile theme and amp add on web site then showing
    Eroro
    Warning: is_readable(): open_basedir restriction in effect. File(/Newspaper/theme.json) is not within the allowed path(s): (/home/lhrpkacw/:/tmp:/var/tmp:/opt/alt/php74/usr/share/pear/:/dev/urandom:/usr/local/lib/php/:/usr/local/php74/lib/php/) in /home/lhrpkacw/domains/qm.com.pk/public_html/thenews/wp-includes/class-wp-theme-json-resolver.php on line 433

    Reply

Leave a Comment