Open Basedir Restriction: Difference between revisions

m KazVee moved page OpenBasedirRestriction to Open Basedir Restriction without leaving a redirect
m Update error message since codeblock required sidescrolling
 
(5 intermediate revisions by the same user not shown)
Line 7: Line 7:
If your script tries to access files outside your home directory, you will receive an error similar to:
If your script tries to access files outside your home directory, you will receive an error similar to:


<pre>
"Warning: function(): open_basedir restriction in effect. File(/filename.php) is not within the allowed path(s): (/home/username.domain.com/:/tmp/) in /home/username.domain.com/httpdocs/filepath/file.php on line 123"
Warning: function(): open_basedir restriction in effect. File(/filename.php) is not within the allowed path(s): (/home/username.domain.com/:/tmp/) in /home/username.domain.com/httpdocs/filepath/file.php on line 123
</pre>


== How to Fix the Error ==
== How to Fix the Error ==
Line 17: Line 15:
To resolve the error(s), edit your configuration to only try to access things inside your home directory.
To resolve the error(s), edit your configuration to only try to access things inside your home directory.


For instance, if your software is trying to write to `/var/php/session` you could change it to `/home/maindomain.helioho.st/session`.
For instance, if your software is trying to write to '/var/php/session' you could change it to '/home/maindomain.helioho.st/session'.


== Unable to Edit Your Configuration ==
== Unable to Edit Your Configuration ==
Line 27: Line 25:
== Can the open_basedir restriction be disabled or changed? ==
== Can the open_basedir restriction be disabled or changed? ==


No. The open_basedir restriction is a `php.ini` directive which has been enabled for the security and privacy of all our users. It cannot be removed or changed.  
No. The open_basedir restriction is a 'php.ini' directive which has been enabled for the security and privacy of all our users. It cannot be removed or changed.


The only way to not have the open_basedir restriction apply to your hosting account would be to get a [https://heliohost.org/vps/ VPS].
{{Info|The only way to not have the open_basedir restriction apply to your hosting account would be to get a [https://heliohost.org/vps/ VPS]. You can get a 10% discount when you pay for 6 months upfront.}}

Latest revision as of 20:02, 17 January 2025

Error: open_basedir restriction in effect

What is the open_basedir restriction?

This is a security measure which prevents you from accessing files in someone else's directory. You can only access things inside your home directory.

If your script tries to access files outside your home directory, you will receive an error similar to:

"Warning: function(): open_basedir restriction in effect. File(/filename.php) is not within the allowed path(s): (/home/username.domain.com/:/tmp/) in /home/username.domain.com/httpdocs/filepath/file.php on line 123"

How to Fix the Error

Edit Your Configuration

To resolve the error(s), edit your configuration to only try to access things inside your home directory.

For instance, if your software is trying to write to '/var/php/session' you could change it to '/home/maindomain.helioho.st/session'.

Unable to Edit Your Configuration

If you're not able to edit your configuration, your options are:

  • Switch to another software that allows you to configure filepaths to try to access things only inside your home directory.
  • Switch to a VPS where you would have the whole server to yourself and there wouldn't be anyone else's files for you to access.

Can the open_basedir restriction be disabled or changed?

No. The open_basedir restriction is a 'php.ini' directive which has been enabled for the security and privacy of all our users. It cannot be removed or changed.

The only way to not have the open_basedir restriction apply to your hosting account would be to get a VPS. You can get a 10% discount when you pay for 6 months upfront.


This page was last edited on 17 January 2025, at 20:02.