2016-04-20 69 views
0

我尝试了20次可能,与Apache,与Nginx,在Windows上,在Ubuntu上,跟着数百万的教程和书籍,仍然是同样的事情,我变得非常沮丧,所以请帮帮我。我想要的是简单的Hello World在browser.I已经structure.First以下是MasteringMagento_Example.xml:什么可能是我的模块不工作的原因

<?xml version="1.0" ?> 

<config> 
    <modules> 
    <MasteringMagento_Example> 
    <active>true</active> 
    <codePool>local</codePool> 
    <depends /> 
    </MasteringMagento_Example> 
    </modules> 
</config> 

我的结构MasteringMagento /例,并有座,型号,controolers ...文件夹。在etc config.xml的是以下内容:

<config> 
    <modules> 
     <MasteringMagento_Example> 
      <version>0.0.0</version> 
     </MasteringMagento_Example> 
    </modules> 
    <global> 
     <models> 
      <example> 
       <class>MasteringMagento_Example_Model</class> 
      </example> 
     </models> 
     <blocks> 
      <example> 
       <class>MasteringMagento_Example_Block</class> 
      </example> 
     </blocks> 
     <helpers> 
      <example> 
       <class>MasteringMagento_Example_Helper</class> 
      </example> 
     </helpers> 
    </global> 

    <frontend> 
     <routers> 
     <example> 
     <use>standart</use> 
     <args> 
      <frontName>example</frontName> 
      <module>MasteringMagento_Example</module> 
     </args> 
     </example> 
     </routers> 
    </frontend> 
</config> 

而在控制器文件夹文件HelloController.php:

<?php 

class MasteringMagento_Example_HelloController extends Mage_Core_Controller_Front_Action 
{ 

    public function indexAction(){ 
     echo 'hello'; 
    } 
    public function worldAction(){ 
     echo 'hello world'; 
    } 

} 

当我输入magento.local /示例/你好/ WOR LD,我得到:

哎呦,我们的坏...

您请求的页面不存在了,我们有一个美好的猜测原因。

If you typed the URL directly, please make sure the spelling is correct. 
    If you clicked on a link to get here, the link is outdated. 

哎呦,我们的坏...

您请求的页面不存在了,我们有一个美好的猜测原因。

If you typed the URL directly, please make sure the spelling is correct. 
    If you clicked on a link to get here, the link is outdated. 

你能做什么? 不用担心,求助近!有很多方法可以让你回到Magento商店。

Go back to the previous page. 
    Use the search bar at the top of the page to search for your products. 
    Follow these links to get you back on track! 
    Store Home | My Account 

我运行Ubuntu nginx的作为服务器时,magento.local正在加载起始页面,但之后没有工作,请帮帮我,可能是什么原因,我真的很沮丧 你能做什么? 不用担心,求助近!有很多方法可以让你回到Magento商店。

Go back to the previous page. 
    Use the search bar at the top of the page to search for your products. 
    Follow these links to get you back on track! 
    Store Home | My Account 
+0

您是否有PHP和XML的结束标记?此外,这是很多代码在屏幕上打印“Hello World”。我会先修复php语法,然后回滚所有额外的代码,直到它开始工作。单独的PHP可以在屏幕上打印“Hello World”,所以有些东西阻止了你的php。 – Sparky256

+0

我想在Magento中加载模块,我知道PHP可以打印你好世界,但我想学习magento,它使用自定义模块和xml配置。问题不在于关闭php标签,其他东西很多更复杂。我一整天都陷在这个s * bug中 – dobrganch

+0

试试localhost/magento/example/hello/world。所有浏览器都了解url快捷方式'localhost'。如果您运行本地主机服务器,它是您的浏览器允许访问内部页面的唯一方式。我不认为这是完整的答案,甚至不完整,但浏览器应该回应。 – Sparky256

回答

0

我会说因为你写标准而不是标准。

Michele

+0

该OP有几个嘘声修复。 – Sparky256

相关问题