调用索引控制器 - 模块时出现404页面错误

时间:2015-02-05 07:42:57

标签: magento module

模块正在本地服务器上工作,但在移动到Linux服务器后无法工作。我确定所有文件都只有大写字母请指出我错过的错误

 Apptha_Subscription.xml

<config>        
    <modules>        
        <Apptha_Subscription>
            <active>true</active>
            <codePool>local</codePool>
        </Apptha_Subscription>
    </modules>
</config>

confix.xml

<config>
    <modules>
        <Apptha_Subscription>
            <version>0.1.0</version>
        </Apptha_Subscription>
    </modules>
    <frontend>
        <routers>
            <subscription>
                <use>standard</use>
                <args>
                    <module>Apptha_Subscription</module>
                    <frontName>subscription</frontName>
                </args>
            </subscription>
        </routers>
        <layout>
            <updates>
                <subscription>
                    <file>subscription.xml</file>
                </subscription>
            </updates>
        </layout>
        <translate>
            <modules>
                <Apptha_Subscription>
                    <files>
                        <default>Apptha_subscription.csv</default>
                    </files>
                </Apptha_Subscription>
            </modules>
        </translate>
    </frontend>
    <global>                       
        <blocks>
            <subscription>
                <class>Apptha_Subscription_Block</class>
            </subscription>
        </blocks>
        <models>
        	 <subscription>
                <class>Apptha_Subscription_Model</class>
                <resourceModel>subscription_mysql4</resourceModel>
            </subscription>
            <subscription_mysql4>
                <class>Apptha_Subscription_Model_Mysql4</class>
                <entities>
                 <subscriptionpaymentdetails>
                        <table>subscription_payment_details</table>
                 </subscriptionpaymentdetails>
                 <subscriptionorderdetails>
                        <table>subscription_order_details</table>
                 </subscriptionorderdetails>    
                </entities>
                </subscription_mysql4>
        </models>
        <helpers>
            <subscription>
                <class>Apptha_Subscription_Helper</class>
            </subscription>
        </helpers>
    </global>
    <admin>
	<routers>
	  <subscription>
	    <use>admin</use>
		<args>
		  <module>Apptha_Subscription</module>
		  <frontName>subscription</frontName>
		</args>
	  </subscription>
	</routers>
  </admin>  
   <global>
   	<events>
   		 <customer_register_success>
            <observers>
                <airhotels>
                   <type>singleton</type>
                   <class>Apptha_Subscription_Model_Observer</class>
                   <method>customer_register_success</method>
                </airhotels>
            </observers>
      	  </customer_register_success>      	  
   	 </events>
   </global>
</config>
block 
Subscription.php

class Apptha_Subscription_Block_Subscription extends Mage_Core_Block_Template
{
	/**
	 * Method to get the layouts
	 * 
	 * @return void
	 */	
	public function _prepareLayout()
    {
		return parent::_prepareLayout();
    }        
    
    /**
     * Method to get the initial details of before payment of customer
     *
     * @return array
     */
    
    public function intialDetailsBPay()
    {
    	if(Mage::getSingleton('customer/session')->isLoggedIn())
    	{
    		$customerData 		= Mage::getSingleton('customer/session')->getCustomer();
    		$customerId		= $customerData->getId();
    
    		return $intialDetailsBPay 	= Mage::getModel('subscription/subscriptionpaymentdetails')->load($customerId,'customer_id');
    	}
    	 
    }
}
<p>controller</p>
IndexController.php

class Apptha_Subscription_IndexController extends Mage_Core_Controller_Front_Action {

	/*
     * this method privides default action.
     */
    public function indexAction()
    {    

        /*
         * Initialization of Mage_Core_Model_Layout model
         */
        $this->loadLayout();
 
        /*
         * Building page according to layout confuration
         */
        $this->renderLayout();
    }

    public function insertsubscribeAction()
    {
    	$this->loadLayout();
    	
    	Mage::app()->getLayout()->getBlock('subscription_subscription');
    	$this->renderLayout();
    }
    
}
   layout/subscription.xml

<layout version="0.1.0">
    <!--Page handle -->
    <subscription_index_index>
    	<!-- reference tag specifies the block where we a going to add child block -->
    	 <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <reference name="content">
            <!-- Our page content block -->
            <block type="subscription/subscription" name="subscription" template="subscription/subscription.phtml">				
            </block>
        </reference>
    </subscription_index_index> 
    <subscription_subscribe_insertsubscribe>    
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
       <reference name="content">
            <!-- Our page content block -->
            <block type="subscription/subscription" name="subscription" template="subscription/paypalbutton.phtml">				
            </block>
        </reference>
    </subscription_subscribe_insertsubscribe>   
</layout> 

1 个答案:

答案 0 :(得分:1)

如果同一模块在Localhost上工作但在迁移后没有工作,则很可能权限不适合Linux服务器上迁移的文件。我建议请检查所有模块文件的权限。

其次,确保没有剩余要迁移的依赖关系。