Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open_basedir restriction and file environment.php not allowed in the path #86

Closed
cywtf opened this issue Jan 23, 2015 · 13 comments
Closed
Assignees
Milestone

Comments

@cywtf
Copy link

cywtf commented Jan 23, 2015

I can't install unmark in my server either. I am having this error message:

Warning: file_exists(): open_basedir restriction in effect. File(/etc/unmark/environment.php) is not within the allowed path(s): (/nfs:/tmp:/usr/local:/etc/apache2/gs-bin) in /nfs/c05/h03/mnt/00000/domains/unmark.mydomain.com/html/index.php on line 43

I googled it extensively and also checked the issue with my webhosting provider, which replied:

The path that your script attempts to reference:
/etc/unmark/environment.php
is inaccessible to your sites because the Grid is a shared service, and as such, you don't have access to that folder on the shared server. You'll need to reconfigure your script such that it is attempting to utilize folders within your document root for this site, which I've listed below:
/domains/unmark.mydomain.com/html

For more information on the error you received, please see our KnowledgeBase article on this topic:
https://kb.mediatemple.net/questions/514/How+do+I+set+the+path+for+open_basedir%3F#gs
Please note that if the scripting is related to a CMS requiring root access, you won't be able to configure it on the Grid due to the shared nature of the Grid hosting.

My questions:

  • How can I reconfigure the script to utilize folders within the document root for the site?
  • And is it really true that I need root access in order to install the app? If so, why is not mentioned in the installation requirements?

Any help would be appreciated. Thanks!

@ghost
Copy link

ghost commented Jan 29, 2015

Good Day @Rootion,
Let me try to answer your questions the best I can. While I am not a Unmark developer I have years experience in working with PHP..

"How can I reconfigure the script to utilize folders within the document root for the site?"
I believe your talking about the direct reference to /etc/unmark/environment. This path can be easily be changed by modifying line 40 of index.php

"And is it really true that I need root access in order to install the app? If so, why is not mentioned in the installation requirements?"
Having root access is not a requirement to installing this application. While there are references to paths that may not be accessible to normal users, they are being addressed in PR #87

cdevroe added a commit that referenced this issue Jan 30, 2015
using is_readable as a permissions check, fix for #86
@cdevroe cdevroe closed this as completed Jan 30, 2015
@cdevroe cdevroe added this to the 1.6.2 milestone Jan 30, 2015
@cywtf
Copy link
Author

cywtf commented Feb 13, 2015

hi @williamknauss,

Thanks for your reply. Can you please help me to change the path in the line 40 of index.php?
What exactly should I replace instead of /etc/unmark/environment? I am having issues with that.
I am trying to install unmark in unmark.mydomain.com

Thanks!

@ghost
Copy link

ghost commented Feb 13, 2015

Good Day @Rootion,
Try downloading the newest master branch from here.

Your issue was resolved and there shouldn't be a need to change the configuration path anymore.

Let me know how it goes.

Cheers Mate

@cywtf
Copy link
Author

cywtf commented Feb 17, 2015

Hi @williamknauss

I dont know what I am doing wrong. I downloaded the newest master branch, imported my server settings but I keep getting the following error:

Warning: is_readable(): open_basedir restriction in effect. File(/etc/unmark/environment.php) is not within the allowed path(s): (/nfs:/tmp:/usr/local:/etc/apache2/gs-bin) in /nfs/c05/h03/mnt/00000/domains/mydomain.com/html/index.php on line 43

@ghost ghost reopened this Feb 17, 2015
@ghost
Copy link

ghost commented Feb 18, 2015

Hi @Rootion,
I re-opened this ticket. Right now I'm spinning up a linux VPS to double test this issue.I'll get back to you once we get this straightened out.

Thanks for your patient mate.

@cywtf
Copy link
Author

cywtf commented Feb 18, 2015

Hi @williamknauss

After researching a lot more, I found something that can help to solve this issue. It's actually in Mediatemple documentation: http://kb.mediatemple.net/questions/514/How+do+I+set+the+path+for+open_basedir%3F#gs

which suggests to add the following line to my php.ini:
open_basedir = "/path/to/first/folder:/path/to/second/folder

However I am not that pro in php. How exactly should I rewrite this line?
I assume the path to the first folder should be /etc/unmark/environment.php and the path for my second folder should be /home/00000/domains/unmark.mydomain.com/html/ but I am not entirely sure.

Can you please confirm? Thanks man.

@ghost ghost added the setupIssue label Feb 18, 2015
@cdevroe cdevroe assigned cdevroe and ghost and unassigned cdevroe and ghost Feb 18, 2015
@cdevroe cdevroe modified the milestones: 1.6.3, 1.6.2 Feb 18, 2015
@cdevroe cdevroe closed this as completed Feb 18, 2015
@ghost
Copy link

ghost commented Feb 18, 2015

Hi @Rootion,
After talking with @cdevroe this afternoon we both agreed it would be best if this troubling code was removed. So I am happy to say that it has been removed and this problem should no longer plague you. You also won't be required to change the open_basedir directive in PHP.

Try downloading (yet again) the newest master branch and let us know how it goes.

Thanks for your patient mate your a champ!

@cywtf
Copy link
Author

cywtf commented Feb 19, 2015

hey @williamknauss

Thanks for your efforts too. I uploaded the new master branch but still didnt succeed installing unmark., Now whenever I go to unmark.mydomain.com/setup it redirects me to the login screen (which is in unmark.mydomain.com) and I can't even start the setup.

I don't seem to have luck here. What could be the issue?
I can send you my website url per email if that can help.

@ghost
Copy link

ghost commented Feb 21, 2015

Hi @Rootion,
Again I am really sorry that you are having so many issues getting Unmark installed. Do you have tables in your database already? If so delete all the tables in your database and then try running setup again.

@cywtf
Copy link
Author

cywtf commented Feb 23, 2015

That worked! it's working. Yey. Many thanks!

@ghost
Copy link

ghost commented Feb 23, 2015

Sweet! Glad we got it working mate! 💯

@ShinyShrimp
Copy link

Hmmm it seems that I'm having the same error like him with current master:

Warning: is_readable(): open_basedir restriction in effect. File(/etc/unmark/environment.php) is not within the allowed path(s): (/www/htdocs/w00be84b/:/tmp:/usr/bin:/www/htdocs/w00be84b:/bin:/usr/local/bin:/usr/share/php:/dev/urandom) in /www/htdocs/w00be84b/www.jan-asmuth.de/unmark/index.php on line 43

I try to run unmark on my webhosting and have also no root-access

what can I do to solve this issue?

@ghost
Copy link

ghost commented Mar 23, 2015

Hi @ShinyShrimp,
I think you need to update your master again mate. I just checked our index.php on line 43 and we no longer have the call to /etc/unmark/environment.php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants