Open_basedir restriction in effect wordpress

I am actually trying to set up my localhost Wordpress installation to my apache server and I have some trouble to access the index.php or any other file in my Wordpress installation. Indeed I have a blank page while accessing "www.mysite.com/blog". Knowing that I can't modify apache2.conf or any configuration file by myself, I wanted to know if there is any other solution to fix this.

Here is what I obtain in error.log:

[Thu Jul 02 08:57:21 2015] [error] [client 104.6.36.81] PHP Warning:  Unknown: open_basedir restriction in effect. File(/var/www/vhosts/mysite.com/httpdocs/blog/index.php) is not within the allowed path(s): (/var/www/vhosts/mysite.com/httpdocs:/tmp) in Unknown on line 0
[Thu Jul 02 08:57:21 2015] [error] [client 104.6.36.81] PHP Warning:  Unknown: failed to open stream: Operation not permitted in Unknown on line 0
[Thu Jul 02 08:57:21 2015] [error] [client 104.6.36.81] PHP Fatal error:  Unknown: Failed opening required '/var/www/vhosts/mysite.com/httpdocs/blog/index.php' (include_path='.:') in Unknown on line 0

Moreover, the owner of "blog" is me.

Any help would be welcomed :)


jakubN-9

I just found error:
Warning: is_readable(): open_basedir restriction in effect. File(https://cdn.wpml.org/languages//pl_PL.mo) is not within the allowed path(s):

It is printed on login page.

Very strange is file path with double"/".
Any idea how to fix it?


jakubN-9

correct erron is on image

Open_basedir restriction in effect wordpress


Christopher Amirian

Supporter

  • Open_basedir restriction in effect wordpress

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

Would you please kindly follow the steps below to provide the debug information?

- Go to "WordPress Dashboard > WPML > Support > Debug Information (Link)".
- Copy the Debug Information from there.
- Get back to this chat screen and scroll down.
- Find the "Additional Data" section below. (Check the screenshot below)
- Click on the "Debug Info" item to expand it.
- Paste the debug information into the text area.
- Click the "Send Debug Info" button.

Screenshot:
https://wpml.org/wp-content/uploads/tmp/debug_info_20.png

Without having the debug info, I am going to ask you to do the following for the moment:

1. Make sure WPML is up to date

- IMPORTANT STEP! Create a backup of your website.
- Go to "WordPress Dashboard > Plugins > Add new > Commercial (tab)".
- Update WPML and its addons there.

For more information:
https://wpml.org/faq/install-wpml/#automated-updates

2. Make sure you have enough PHP memory Limit on your system.

The minimum requirement is 128M but I suggest that you increase it to 512M: https://wpml.org/home/minimum-requirements/

You can add this by adding the code below to "wp-config.php" file of your WordPress installation root folder:

/** Memory Limit */
define('WP_MEMORY_LIMIT', '512M');
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

Please add the code above the line below:

/* That's all, stop editing! Happy blogging. */

3. Check for a possible Theme or plugin conflict.

- IMPORTANT STEP! Create a backup of your website.
- Switch to the default theme such as "TwentyTwenty" by going to "WordPress Dashboard > Appearance > themes".
- Go to "WordPress Dashboard > Plugins" and deactivate all plugins except WPML and its add-ons.
- Check if you can still recreate the issue.
- If not, re-activate your plugins one by one and check the issue each time to find out the plugin that causes the problem.

Kindly get back to us with the result of the steps above and the debug information.

Thank you.

After running the System Check I am receiving warning messages about open_basedir restrictions.

The System Check will attempt to fix your PHP configuration by creating a php.ini file in your WordPress root folder (action triggered by the "Attemp to fix PHP configuration" button). The respective file contains the adjusted settings of your php variables. One of this variables is open_basedir which limits the files that can be opened by PHP to the specified directory-tree. By default, the paths to your WordPress root folder and your Temp-folder should be added to the allowed paths list, however other plugins may require additional paths to be added to the respective list. In order to add other paths to open_basedir you will have to edit the php.ini file from your WordPress root folder and add the paths as it is presented here:

  • For Windows: open_basedir=/path/to/your/root_folder;/path/to/your/temp_folder;/path/to/your/additional_folder
  • For Linux: open_basedir=/path/to/your/root_folder:/path/to/your/temp_folder:/path/to/your/additional_folder

Note: Improper configuration of this variable may cause your entire WordPress site to break.

Was this article helpful?

Yes No

What is Open_basedir restriction?

What is open_basedir? It is a restriction to prevent a hosting package user from accessing any paths on the server that are not authorised, such as the paths to other domains on shared web servers, or to access the hosting software.

How to disable open_ basedir WordPress?

To disable open_basedir on DirectAdmin, you should have Admin level access. Click on PHP SafeMode Configuration-> Php Safe Mode Settings -> Here you can enable/diable open_basedir for your domains.