Magento Forum

Invoking Magento from Addon Domain Fails with ‘Zend_Controller_Response_Exception’
 
infradawn
Jr. Member
 
Total Posts:  24
Joined:  2008-02-02
White Peak UK
 

Hi, I’ve done some serious head-scratching on this one. Checked out the Magento boards and zfforums and every hint and tip has been followed up without success. Time to send a SOS to the community. All help much appreciated.

I’ve installed Magento 0.7.15480 in: /usr/local/4admin/apache/vhosts/mydomain.com/httpdocs/stores
Browsing to http://www.mydomain.com/stores displays the Magento home page. So far so good. But…
I need to invoke Magento from an addon domain.
The addon domain path is: /usr/local/4admin/apache/vhosts/mydomain.com/addon/store.addondomain.com
I have two files in the addon domain root: .htaccess and index.php
The only change to the packaged .htaccess is to support php5 CGI (and is correct for my host):

############################################
## php5 handler
AddHandler cgi-php5 .php
The only change to the packaged index.php is modification of the include path to include the Magento installation folder. It occurs immediately before the line: require_once ‘app/Mage.php’; and results in: include_path= .:/usr/local/4admin/apache/php5/lib/php:/usr/local/4admin/apache/vhosts/mydomain.com/httpdocs/stores
ini_set('include_path'ini_get('include_path').PATH_SEPARATOR.dirname(dirname(dirname(__FILE__))).'/httpdocs/stores');
Browsing to http://store.addondomain.com gives this error:
exception 'Zend_Controller_Response_Exception' with message 'Cannot send headers; headers already sent in 

/usr/local/4admin/apache/vhosts/mydomain.com/addon/store.addondomain.com/index.php, line 30' 
in 

/usr/local/4admin/apache/vhosts/mydomain.com/httpdocs/stores/lib/Zend/Controller/Response/Abstract.php:265
Stack trace
:
#0 /usr/local/4admin/apache/vhosts/eixus.com/httpdocs/stores/lib/Zend/Controller/Response/Abstract.php(98): Zend_Controller_Response_Abstract-

>canSendHeaders(true)
#1 /usr/local/4admin/apache/vhosts/eixus.com/httpdocs/stores/app/code/core/Mage/Core/Model/App.php(588): Zend_Controller_Response_Abstract->setHeader

('Content-Type''text/html; char...')
#2 /usr/local/4admin/apache/vhosts/eixus.com/httpdocs/stores/app/code/core/Mage/Core/Controller/Varien/Front.php(72): Mage_Core_Model_App->getResponse()
#3 /usr/local/4admin/apache/vhosts/eixus.com/httpdocs/stores/app/code/core/Mage/Core/Model/Url/Rewrite.php(133): Mage_Core_Controller_Varien_Front-

>getResponse()
#4 /usr/local/4admin/apache/vhosts/eixus.com/httpdocs/stores/app/code/core/Mage/Core/Controller/Varien/Front.php(109): Mage_Core_Model_Url_Rewrite->rewrite

()
#5 /usr/local/4admin/apache/vhosts/eixus.com/httpdocs/stores/app/code/core/Mage/Core/Model/App.php(206): Mage_Core_Controller_Varien_Front->init()
#6 /usr/local/4admin/apache/vhosts/eixus.com/httpdocs/stores/app/code/core/Mage/Core/Model/App.php(401): Mage_Core_Model_App->_initFrontController()
#7 /usr/local/4admin/apache/vhosts/eixus.com/httpdocs/stores/app/Mage.php(379): Mage_Core_Model_App->getFrontController()
#8 /usr/local/4admin/apache/vhosts/eixus.com/addon/store.equineresearch.co.uk/index.php(39): Mage::run('base')
#9 {main}
What am I missing?
 
Magento Community Magento Community
Magento Community
Magento Community
 
infradawn
Jr. Member
 
Total Posts:  24
Joined:  2008-02-02
White Peak UK
 

Maybe this problem is trivial. So I’ll re-enroll in php 101. Now, what did I miss?
Maybe it’s been covered on a board somewhere. It’s a big Internet. Help me out with a link.
Maybe the problem is with Magento or the framework. Hell, this is feedback - please respond. I don’t bite.

iD

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

When i go here: http://www.store.equineresearch.co.uk/ it outputs a string:

include_path = .:/usr/local/4admin/apache/php5/lib/php:/usr/local/4admin/apache/vhosts/eixus.com/httpdocs/stores

Did you put some debugging echo ? Try removing it.

The error actually says that output already started and it’s not able to send headers to browser.

 
Magento Community Magento Community
Magento Community
Magento Community
 
infradawn
Jr. Member
 
Total Posts:  24
Joined:  2008-02-02
White Peak UK
 

Hi Moshe,

This is one of those “DOH!” moments isn’t it? That debug echo was left in from looking at an earlier problem. Took it out and bingo - headers exception gone! I now have a problem with some links having different URL roots, but I have a plan…

Thanks, I’m moving forward again

iD

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top