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).

Leave a Reply

Your email address will not be published. Required fields are marked *