Archive for January, 2012
Setting up Magento in XAMPP
0Some of you may be banging your head against a wall trying to figure out how to setup Magento in your local XAMPP installation. Fret not aggravated peoples, we have found the answer!
As you may know, Magento is a popular e-commerce platform that can handle anything from small business to enterprise e-commerce solutions. Despite it’s rather large size and not-very-optimized code, the community edition of Magento is notorious for having excessively large databases and a single .log file that is around 3GB after awhile (which is what we encountered)…
However, if you are installing a FRESH COMMUNITY EDITION (version 1.6.2.0 at the time of this tutorial’s birth), then we will go through the steps with you one by one!
The Process
Herein lies the process for installing magento:
Step One
Download the most recent community edition of magento!
Step Two
Go to http://localhost/phpmyadmin/ and add a new database!

Step Three
Extract the magento files in C:\xampp\htdocs\magento\ for Windows
OR
/Applications/XAMPP/htdocs/ on Mac
Note: the above directories are the default directories and may not necessarily be the places where you installed xampp. If this is different, then extract your magento files into the ApacheDoc document root “htdocs” folder of your xampp installation.
Step Four
Next we should update our hosts and get it out of the way now. Bear in mind, the hosts file maps domain names to ip addresses. When you type a domain into your browser window, your browser will check to see if there is a matching entry for that domain name in your host file.
On Windows navigate to C:\windows\system32\drivers\etc right click on your hosts file and select edit. You will see a bunch of random numbers which are ip addresses.
Add:
1 | 127.0.0.1 magento.localhost.com |
and save the file.
Press the window key + r (or simply search for and/or open cmd.exe) and type the following:
1 | ipconfig /flushdns |
Editing the Hosts File on Mac
Open Terminal and type the following (after each command press return):
We need to open the hosts file for editing
1 | $ sudo nano /private/etc/hosts |
Add this to the bottom of the hosts file
1 | 127.0.0.1 magento.localhost.com |
When done editing the hosts file, press control-o to save the file.
Press enter on the filename prompt, and control-x to exit the editor.
Now we must flush the DNS cache on our system!
1 | $ dscacheutil -flushcache |
Step Five
Assuming all went well, you are now ready to open your favorite web browser and type in magento.localhost.com/magento/ and you will be redirected to the magento installation screen!
Some options to you should choose when configuring your database information:
- Skip URL Validation
- Use Apache Server Rewrites
As you process through the installation process, please be patient. Do NOT click multiple times on any field especially the page where you enter in database information. Magento has a very extensive database and therefore it takes time to install and add all of the tables and populate those tables with relevant information.
Step Six
That’s it! You should have a fully functioning Magento application on your XAMPP installation!
Fixing T_PAAMAYIM_NEKUDOTAYIM with Clever CMS in Magento 1.6
2After a recent upgrade to Magento 1.6.2.0 and using Clever CMS, we realized there was an issue on our frontend! We saw a weird error we had never seen before with an older version of Clever CMS.
1 | Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /home/<em>your_account</em>/public_html/app/code/community/Clever/Cms/Model/Page.php on line 101 |
Some of you might be wondering what in the world who/what T_PAAMAYIM_NEKUDOTAYIM actually is. Aside from being an influential programmer, a T_PAAMAYIM_NEKUDOTAYIM is the double colon system that PHP uses to call a parent class’s static field, static constant, static variable, or static method. Thankfully, resolving this error is easy to fix.
Step 1
Open your favorite text editor or log into your web host via terminal and go to public_html/app/code/community/Clever/Cms/Model/Page.php. Open the file with your text editor or a edit or vim command in shell. Go to line 101 or find the method called getChildren.
1 2 3 4 5 6 7 8 9 10 11 | public function getChildren() { $collection = $this->getCollection(); // $collection->setOrder('position', $collection::SORT_ORDER_ASC); $collection->setOrder('position', $collection->SORT_ORDER_ASC); $collection->getSelect() ->where('main_table.store_id = ?', $this->getStoreId()) ->where('main_table.parent_id = ?', $this->getId()); return $collection; } |
Notice the line commented out with $collection::SORT_ORDER_ASC. We need to change the :: to a -> because $collection is an object calling a static constantin the Mage_Cms_Model_Page class. In fact, if we look in Magento 1.6.2.0 we’ll see that this static constant doesn’t even exist in this class or it’s parent class (Mage_Core_Model_Abstract)!
That should fix anyone’s issue with this error!




