Open Basedir Restriction: Difference between revisions

m Update to use H2 headers for better readability
m Use {{Template:VPSInfo}} for VPS Info
 
(One intermediate revision 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 23: Line 21:
If you're not able to edit your configuration, your options are:
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 another software that allows you to configure filepaths to try to access things only inside your home directory.  
* Switch to a [https://heliohost.org/vps/ VPS] where you would have the whole server to yourself and there wouldn't be anyone else's files for you to access.
* 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. {{Template:VPSInfo}}


== Can the open_basedir restriction be disabled or changed? ==
== Can the open_basedir restriction be disabled or changed? ==
Line 29: Line 27:
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.


{{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.}}
{{Info|The only way to not have the open_basedir restriction apply to your hosting account would be to get a VPS. {{Template:VPSInfo}}}}

Latest revision as of 18:47, 31 August 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. We offer a range of VPS plans starting at only $4 a month, with storage options from 50 GB to 300 GB, and a 10% discount when you pay for six months upfront.

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. We offer a range of VPS plans starting at only $4 a month, with storage options from 50 GB to 300 GB, and a 10% discount when you pay for six months upfront.


This page was last edited on 31 August 2025, at 18:47.