June 2010

Magento Upload HTTP Error [SOLVED]

Magento Upload HTTP Error [SOLVED]

This was a strange error with Magento. I was in a product, trying to upload an image. The image would upload find, but then error out with "Upload HTTP Error". I changed permissions up and down the /media and /var directories and made them as loose with permissions as I could.

Still no change.

Then I happened upon this comment in the forums.

To anyone that has a HTTP upload error AND has a password protected store directory (for under construction reasons):
remove the directory password protection and you’ll be able to upload your files again! That was what happened to me.

BINGO!

I removed the password protection for the admin (not the Magento password, but Apache basic password protection).

Reference:
http://www.magentocommerce.com/boards/viewreply/154831/

Magento and Zend Server checkout redirect to cart [solved]

Magento and Zend Server checkout redirect to cart [solved]

IMG_3623.JPG

I installed Zend Server CE on one of my machines. The next day I noticed that you could not checkout from the website. It would bring you to the to the Billing Address, then after you hit "continue" it would redirect you back to the checkout page. No errors that I could see.

Then I remember a problem I had many moons ago that was very similar and a forum comment jogged my memory. Magento is looking for a Com.php file buried deep in the bowls of Zend Framework.

Did you know that Zend Server includes the latest copy of the Zend Framework? Yes and therein lies the problem, the Zend Framework version of Zend Server was overriding the built in Zend Framework of Magento.

Easy solution

Open up your .htaccess file and add this section in there somewhere. This will reset your include path, Magento will build this for you anyway so it shouldn't cause a problem.

###########################################
## Reset Include path
 
   php_value include_path  "."

Resources:
http://www.magentocommerce.com/boards/viewthread/28231/#t200692

Rollback CentOS updates with RPM and YUM

Rollback CentOS updates with RPM and YUM

Every server administrator likes to sleep at night and every server admin knows server updates could prove disastrous. Just found out that RPM and Yum allow you the ability to rollback an update if some how it sent your system into a choking fit.

In your /etc/yum.conf at this in there somewhere

tsflags=repackage

This will repackage all your old files from the package (including config files) and store them in /var/spool/repackage

Also add the file /etc/rpm/macros and place this in that new file

%_repackage_all_erasures 1

When things go wrong

If you want to rollback changes to a certain time, then just issue commands like

rpm -Uhv --rollback '9:00 am'
rpm -Uhv --rollback '4 hours ago'
rpm -Uhv --rollback 'december 25'

Untested Yet

This is just stuff I'm reading, I have yet to test this under fire, maybe I'll play around on a test server

Resources

http://dailypackage.fedorabook.com/index.php?/archives/17-Wednesday-Why-...

Zend Framework - Doctrine ORM strange Zend Tool behavior.

Zend Framework - Doctrine ORM strange Zend Tool behavior.

Zend Framework... awesome.
Doctrine ORB... awesome.

Both of these combined.... PURE AWESOME.

I set up a project just at it says to on this page http://github.com/fmntf/zf-doctrine. It took some doing, but I got it working and was quite happy with my initial results. Then I needed to start a new project, so I just copied all the files, tweaked the DB name was flying with a new project... with one caveat.

One of the modules I created using a YAML file was not getting created in the DB when I ran zf build-project doctrine --reload. It was frustrating, I tried changing a bunch of things.

In the end the whole problem was that the module folder didn't have a controllers folder and that was it. So I created a controllers folder and then it created the corresponding tables in the db. I think this code has much to do with it

application/Bootstrap.php

<?php
 
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
  /**
   *  This will register all the module directories with ZF
   */
  public function _initModuleLoaders()
  {
      $this->bootstrap('Frontcontroller');
 
      $fc = $this->getResource('Frontcontroller');
      $modules = $fc->getControllerDirectory();
 
      foreach ($modules AS $module => $dir) {
          $moduleName = strtolower($module);
          $moduleName = str_replace(array('-', '.'), ' ', $moduleName);
          $moduleName = ucwords($moduleName);
          $moduleName = str_replace(' ', '', $moduleName);
 
          $loader = new Zend_Application_Module_Autoloader(array(
              'namespace' => $moduleName,
              'basePath' => realpath($dir . "/../"),
          ));
      }
  }
 
}