سؤال

Running Magento with multiple stores. The base store works perfectly. On the secondary store when reaching checkout and the switch to https this set of warnings is generated:

Warning: require_once() [function.require-once]: open_basedir restriction in effect.     

File(/var/www/vhosts/mainstore.com/httpdocs/app/Mage.php) is not within the allowed path(s): (/var/www/vhosts/secondarystore.com/httpdocs:/tmp) in /var/www/vhosts/secondarystore.com/httpdocs/index.php on line 41

Warning: require_once(/var/www/vhosts/mainstore.com/httpdocs/app/Mage.php) [function.require-once]: failed to open stream: Operation not permitted in /var/www/vhosts/secondarystore.com/httpdocs/index.php on line 41

Fatal error: require_once() [function.require]: Failed opening required '/var/www/vhosts/mainstore.com/httpdocs/app/Mage.php' (include_path='.:') in /var/www/vhosts/secondarystore.com/httpdocs/index.php on line 41

phpinfo shows the following for open_basedir

local value : /var/www/vhosts/mainstore.com/httpdocs:/tmp
master value: none

What gives?

هل كانت مفيدة؟

المحلول

Tl;DR; Go yell are the person administering your servers.

How'd you run the php_info function? In the same PHP context as Magento, or by itself without bootstrapping Magento? Under the same .htaccess and Apache (or alternative web-server) context as the URL for the sites that are throwing the errors, or under a different URL context? Is your https setup using an identical apache configuration to your http setup? The places to set a php.ini configuration value are legion.

  1. Each domain you have may be using a different php.ini file. The SSL and non-SSL versions of a domain are considered different domains

  2. There are user specific php.ini files

  3. Values can be set via .htaccess files

  4. Values can be set via PHP at at runtime

PHP is yelling at you, most likely because your hosting company/IT guy has PHP's security features cranked to 11 for https URLs. Chances are, even if you can locate where this is being set you can't change it without administrator rights, so find the person who knows how your server works and you'll find the answer you're looking for.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top