open_basedir/.htaccess

I am trying to access some files I placed behind the root.

I am getting the open_basedir error. I assume he answer has something to do with .htaccess, but I can’t seem to find it anywhere.

Any thoughts?

Thanks

matt

Just found this

open_basedir can not be set by an entry in .htaccess or through a script.

So how do I get permission to acces this directory?

This is either set in php.ini or in the virtual host. Either way, unless you have root access to the server you will not be able to edit either.

you could php’s ftp functions to log in via ftp and grab those files, but its slow, and probably not the answer you were looking for.

Thanks for the answer guys. Here is my 2 part follow up:

  1. I just need to contact my host to make this directory writable? If I have another folder within that, do they have to change permissions on that one also, or can I add folders and files after the fact and have them writable. I assume the first one.

  2. After I get enough customers to warrant it, I want to move to a dedicated server. At this point I can get in there and learn how to change this myself. Is that correct?

Thanks Again

Matt

I’m having a similar problem trying to access the PEAR scripts at /usr/share/pear/

The general picture is that I’ve rented a virtual private server. It’s the previous step before getting a dedicated server. I mean, I can create virtual domains under the same IP and have root access to everything there but I don’t have the whole server for myself.

The problem is I’ve installed the PEAR installer and downloaded some packets which are stored in the folder mentioned above. When I use a “require_once” in my scripts (stored in the folder /var/www/vhosts/mydomain.com/httpdocs and subfoldersbelow) I first came accross the “include_path” error so I fixed the include_path value in the php.ini. But then appeared the open_basedir error.

I’v look here and there and what I’ve read about the open_basedir haven’t helped me much. What’s the purpose of this open_basedir? what else do I have to change besides the include_path so I can include the PEAR scripts?

I’ve noticed also that the output of phpinfo() mentions something like master value and local value and no matter what I do to some php.ini values the master value remains the same and they seem to override my changes in php.ini. Do I have to change other things in apache configuration files?

Thanks

yeah your host has it set in httpd.conf, so its overriding your settings.

open_basedir is so that you cant use php to read other peoples files on your server by …/…/…/othersite.com/thier_db_config.php

it can accept multiple paths, so your host could add /usr/share/pear/ as an allowed directory to the list.if they wont, you could install pear in a directory in your doc rot.

Try using a relative path.