Problem Description
You may experience any of the following:
- A repeated error in the server logs like this: PHP Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s)
- You may find images and other resources on your website are not appearing
- Your site may load exceptionally slowly or not at all with a gateway timeout error
- Attempting to upload files in the WordPress admin fails
Problem Resolution
This occurs because your PHP app is trying to access a folder that it does not have access to any longer. This is most frequently caused by a change of domain name or install location/path without making changes to the web app's configuration file (or one of its plugins/modules) so as to update the path to the new one.
WordPress Specific Solution
With WordPress, you will need to remove the hard-coded upload_path setting which will ensure WordPress automatically sets the upload_path, which works great with our systems. See the first solution here to learn how to do this.
ModX Specific Solution
If you are using ModX, this issue has been encountered with the modx_workspaces setting in the database. Look for that field in the database using steps 1-4 in the WordPress solution above, but rather than step 5, look in the workspaces (or modx_workspaces) table and update the path to its new value.
All other PHP apps
If neither of the above solutions apply to you, or it does not solve the problem you will need to check your web app's configuration files and database for any hard-coded paths that do not match the current path to your application and update them with the correct path.
Tip: if you've changed your primary domain, and have additional domains in your hosting plan (subscription), you will need to apply the same solution(s) as described above, in each site's respective database, or make similar changes to any PHP web app hosted within the same subscription.