安装脚本不工作magento 1.9

时间:2014-09-16 06:31:30

标签: php mysql magento install

第一步禁用缓存...已完成...

下面的

是我的文件层次结构:

enter image description here

这是我在app/code/community/Foggyline/HappyHour/etc/config.xml

的config.xml
<?xml version="1.0"?>
 <config>
<modules>
    <Foggyline_HappyHour>
        <version>1.0.0.0</version>
    </Foggyline_HappyHour>
</modules>
<frontend>
    <routers>
        <foggyline_happyhour>
            <use>standard</use>
            <args>
                <module>Foggyline_HappyHour</module>
                <frontName>happyhour</frontName>
            </args>
        </foggyline_happyhour>
    </routers>
</frontend>
<global>
    <blocks>
        <foggyline_happyhour>
            <class>Foggyline_HappyHour_Block</class>
        </foggyline_happyhour>
    </blocks>
    <models>
        <foggyline_happyhour>
            <class>Foggyline_HappyHour_Model</class>
            <resourceModel>foggyline_happyhour_resource</resourceModel>
        </foggyline_happyhour>
        <foggyline_happyhour_resource>
            <class>Foggyline_HappyHour_Model_Resource</class>
            <entities>
                <user>
                    <table>foggyline_happyhour_user</table>
                </user>
            </entities>
        </foggyline_happyhour_resource>
    </models>
    <resources>
        <foggyline_happyhour_setup>
            <setup>
                <model>Foggyline_HappyHour</model>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
            <foggyline_happyhour_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </foggyline_happyhour_write>
            <foggyline_happyhour_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </foggyline_happyhour_read>
        </foggyline_happyhour_setup>
    </resources>
</global>
</config>

和我在app/code/community/Foggyline/HappyHour/sql/foggyline_happyhour_setup/install-1.0.0.0.php

的安装脚本

并尝试将install-1.0.0.0.php重命名为mysql4-install-1.0.0.0.php但不要担心......

 /* @var $installer Mage_Core_Model_Resource_Setup */

  $installer = $this;
  $installer->startSetup();
  $table = $installer->getConnection()
    ->newTable($installer->getTable('foggyline_happyhour/user'))
    ->addColumn('user_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        'identify' => true,
        'unsigned' => true,
        'nullable' => false,
        'primary' => true)
            , 'Id')
    ->addColumn('first_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
        'nullable' => false
            )
            , 'First Name')
    ->addColumn('last_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
        'nullable' => false
            )
            , 'Last Name')
    ->setComment('Foggyline_HappyHour User Entity');

 $installer->getConnection()->createTable($table);
 $installer->endSetup();

现在,当我改编我的商店或访问我的商店的任何页面时......没有任何东西进入mysql .. core_resource表没有任何条目foggyline_happyhour_setup with version 1.0.0.0,我也尝试清除缓存{ {1}}任何帮助或建议都会提前得到很大的帮助...

我是magento的新手......还在学习它......所以我可以成为一名magento开发者......

4 个答案:

答案 0 :(得分:2)

请添加资源的读写权限。

<resources>
<foggyline_happyhour_setup>
        <setup>
            <module>Foggyline_HappyHour</module>
        </setup>
        <connection>
            <use>core_setup</use>
        </connection>
</foggyline_happyhour_setup>
<foggyline_happyhour_write>
        <connection>
            <use>core_write</use>
        </connection>
</foggyline_happyhour_write>
<foggyline_happyhour_read>
    <connection>
        <use>core_read</use>
    </connection>
</foggyline_happyhour_read> 

现在您需要从core_resource中删除资源条目,然后删除缓存并尝试检查。

答案 1 :(得分:1)

检查local.xml中是否没有节点<skip_process_modules_updates>1</skip_process_modules_updates>

答案 2 :(得分:1)

也有这个问题

2016-03-14T19:50:08+00:00 ERR (3): Warning: simplexml_load_string(): resourceModel&gt;

之后的config.xml中有换行符

</resourceModel

因此,检查所有空格和换行符。并且...在index.php上启用magento日志和详细错误。

另一件事。当您删除core_resource表条目时,请务必同时删除foggyline_happyhour_user ...如果不是,您将获得There has been an error processing your request

答案 3 :(得分:0)

请将<model>Foggyline_HappyHour</model>更改为<module>Foggyline_HappyHour</module>。 他们的文件也是错误的。