I am new with Magento. And trying to create my own model.
So I start with a small test
The model folder structure as the following:
FirstStore/Demo/block
FirstStore/Demo/etc/config.xml
FirstStore/Demo/controller
FirstStore/Demo/Model/Product.php
FirstStore/Demo/Helper
FirstStore/Demo/sql
the etc/config.xml
code:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<version>0.0.1</version>
</modules>
</config>
and the Model/Product.php
code:
class FirstStore_Demo_Model_Product
{
public function sayhello(){
echo 'Hello , World with Magento';
}
}
and the app/etc/modules/FirstStore_Demo.xml
code:
<?xml version="1.0"?>
<config>
<modules>
<FirstStore_Demo>
<active>true</active>
<codePool>local</codePool>
</FirstStore_Demo>
</modules>
</config>
finally I am running this code under test.php page at the magento root dir
the test.php
code:
require_once 'app/Mage.php';
Mage::app();
$product = new FirstStore_Demo_Model_Product;
$product->sayhello();
the error at localhost/magento/test.php
is:
Fatal error: Class 'FirstStore_Demo_Model_Product' not found in C:\xampp\htdocs\php\magento\test.php
Best Answer
Magento does not yet support PHP 5.6 officially as the version you stated using in your comments. Please check the System Requirements page for supported software.
Especially in combination with XAMPP it might cause unexpected issues. I would advice you to downgrade to PHP 5.5.