The e-commerce application magento, for some reason, expects to have a lot of permissions on every server. One thing I stumbled upon when trying to install magento, was the creation of /tmp/magento/var.
Since /tmp could be shared between all users, this may not be the safest way. That's why my servers don't allow access to /tmp, but have a personal /tmp-style directory instead.
I got the error:
[Thu Feb 04 21:24:21 2010] [error] [client 1.2.3.4] PHP Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/tmp/magento/var) is not within the allowed path(s): (/blah/blah/website.com:/usr/share/pear:/var/www/error) in /blah/blah/website.com/app/code/core/Mage/Core/Model/Config/Options.php on line 214
The fix is very, very easy. But since I couldn't find anyone else posting the exact fix, I thought I'd do it.
in app/code/core/Mage/Core/Model/Config/Options.php on line 137, you find:
public function getSysTmpDir()
{
return sys_get_temp_dir();
}
Change it to:
public function getSysTmpDir()
{
return $_SERVER['DOCUMENT_ROOT'].'/your_secret_tmp_dir/';
}
Awesome tip. You are right about Magento expecting full permissions to everything. :)
I ´m with similiar problem but i can t fix it. can you geekLab?
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/lib/php//Mage/Page/Block/Html/Wrapper.php) is not within the allowed path(s): (/home/newsecurityshop/:/usr/share/pear/:/var/lib/php/:/tmp/) in /home/newsecurityshop/www/newsecurity/app/code/core/Mage/Core/functions.php on line 145
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/lib/php//Mage/Catalog/Block/Product/Price/Template.php) is not within the allowed path(s): (/home/newsecurityshop/:/usr/share/pear/:/var/lib/php/:/tmp/) in /home/newsecurityshop/www/newsecurity/app/code/core/Mage/Core/functions.php on line 145
Fatal error: Call to a member function getModelInstance() on a non-object in /usr/local/pem/vhosts/111027/webspace/httpdocs/staging/app/Mage.php on line 432. still i got this error. can anyone help me!
THANK YOU!!!
Thank you. Good solution for fix Magento :)