Solved: open_basedir restriction in effect after WordPress move

When moving WordPress to a new server today I got the following error:

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

warning-open-basedir-restriction


This can be resolved easily. It has to do with the upload path of your new server.

Read no more, if you already know what you have to do. But here’s how to get rid of “Warning: is_dir(): open_basedir restriction in effect”

In WordPress you have two locations from where you can set your upload path. Make sure you include the full path to the upload folder. Typically it is 4-5 levels deep until it reaches your wordpress installation.

Where do you set your upload path?

1. In your wp-config.php there is an option:

define(‘WP_TEMP_DIR’,dirname(__FILE__).’/your/server/path/to/wordpress/wp-content/uploads’);

2. In the database the table wp_options also contains the upload_path

wp-options-upload-path

 

Make sure your upload path is not still referring to your old server and you should be fine.

 

Post Author: Tom Pai