Help - Search - Members - Calendar
Full Version: how do I remove open_basedir restriction
The Planet Forums > Control Panels > Plesk
ktvktv
hi I just got a plesk server.
I moved my oscommerce shoppingcart system to the new server but I keep getting the following error .

Warning: open_basedir restriction in effect. File is in wrong directory

I asked oscommerce and they told me to remove open_basedir restriction but I dont know how ....

thanks
Rich2k
If your server is complete run by yourself and with no clients on then you can turn it off in php.ini in your apache conf directory.

However if you are using your server for lots of clients I would only turn it off for your OWN sites (as it's a security setting).

To do this create a vhost.conf file in the conf directory for your domain and insert the following text (for open_basedir and safe mode)

CODE
<Directory "/usr/local/psa/home/vhosts/domain.com/httpdocs/">

php_admin_value safe_mode 0

php_admin_value open_basedir /

</Directory>
xear
I am having the same problem, I tried the above mentioned solution and it still gives me the same error. I have rebooted the server, and then tried other posted solutions (and again rebooted) with the same results.


Anyone have a suggestion?

Thanks,
xear


QUOTE
Originally posted by Rich2k
If your server is complete run by yourself and with no clients on then you can turn it off in php.ini in your apache conf directory.  

However if you are using your server for lots of clients I would only turn it off for your OWN sites (as it's a security setting).

To do this create a vhost.conf file in the conf directory for your domain and insert the following text (for open_basedir and safe mode)

CODE
<Directory "/usr/local/psa/home/vhosts/domain.com/httpdocs/">

php_admin_value safe_mode 0

php_admin_value open_basedir /

</Directory>
RaQServices
If you are attempting to upload files via php, (uses the tmp folder for uploads use this method) or if you just need to change the basedir for a site.

1. ssh as root into your server.
2. cd to your site's folder (/usr/local/psa/home/vhosts/domain.com
3. cd to the conf folder
4. type pico -w vhost.conf
5. type this in the file:


php_admin_value open_basedir "/usr/local/psa/home/vhosts/domain.com/httpdocs:/tmp"


(you can add any folder you need access to by adding :/path/to/folder like i did with the :/tmp folder)

6. to save and exit the file Press Ctrl + o (it will ask what file to save as, just hit enter) Then press Ctrl + x (this will exit)

7. Restart - run - /usr/local/psa/bin/my_apci_rst


This method has worked on all servers I've had with this problem.
xear
I edited the vhost.conf file which I had done in the past with no luck, but when I got to the step of running the command it didn't appear to be found. Any suggestions?



[root@plesk psa]# /usr/local/psa/bin/my_apci_rst
bash: /usr/local/psa/bin/my_apci_rst: No such file or directory
[root@plesk psa]# whereis my_apci_rst
my_apci_rst:



- xear


QUOTE
Originally posted by RaQServices
If you are attempting to upload files via php, (uses the tmp folder for uploads use this method) or if you just need to change the basedir for a site.

1. ssh as root into your server.
2. cd to your site's folder (/usr/local/psa/home/vhosts/domain.com
3. cd to the conf folder
4. type pico -w vhost.conf
5. type this in the file:


php_admin_value open_basedir "/usr/local/psa/home/vhosts/domain.com/httpdocs:/tmp"


(you can add any folder you need access to by adding :/path/to/folder like i did with the :/tmp folder)

6. to save and exit the file Press Ctrl + o  (it will ask what file to save as, just hit enter)   Then press Ctrl + x (this will exit)

7. Restart - run - /usr/local/psa/bin/my_apci_rst


This method has worked on all servers I've had with this problem.
NightHawk
I think you are looking for:

/usr/local/psa/admin/sbin/my_apci_rst
xear
Thanks that got Apache to restart, unfortunately that above solution didn't fix the problem. I am still geting the same error message. I'm out of ideas here.

- xear

QUOTE
Originally posted by NightHawk
I think you are looking for:

/usr/local/psa/admin/sbin/my_apci_rst
yazzer
I have a demo of oscommerce running (cool shopping cart)

Here are my settings: (I don't think the safe_mode off is required)
.com/httpdocs>
php_admin_flag safe_mode off
php_admin_value upload_tmp_dir "/usr/local/psa/home/vhosts/.com/tmp"
php_admin_value open_basedir "/usr/local/psa/home/vhosts/.com/httpdocs:/tmp"


Everything works, except image uploads. That's OK, because I can just upload them myself, and then specify the path/name in the product setup.

Always remember to - my_apci_rst
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.