In my review of Packt Publishing's Drupal E-Commerce with Ubercart 2x, I mentioned that a number of troubles and hiccups caused me to run pretty late with both my review and my creation of a test e-commerce site. What sort of problems? My review and a handful of blog posts leading up to it already mention a few, like image paths that required slashes before Node Import would work. Below are a few more misfires, in no particular order, that I took note of while building my store. (You'll note that none of them seem to be particularly the fault of Ubercart, and certainly not the fault of the Packt book I was working from. They're just a random heap of gremlin-like woes.)
AWOL modules
One day, a giant handful of seemingly-random modules - Ubercart modules like Catalog, Roles, some payment modules, many more, and unrelated modules like Contact, Imagecache modules, Simplenews, Advanced Forum, and Pathauto (!) – were suddenly disabled. Not after any database mucking, disabling of other modules, or anything special. They were simply disabled out of the blue.
Spooky.
I re-enabled them, and then they worked.
AWOL buttons
More spookiness: I had some inexplicable trouble in creating orders and customers; for some reason, the "Submit" button for my new order and customer wouldn't appear. Yet later, in a new attempt, the button did appear and things moved ahead.
Such is the fun of complex open-source products, wielded by mishap-prone users like me. (I add that trivial anecdote simply as an encouragement to newbies: Once in a while something suddenly doesn't work, yet later suddenly does. Don't lose hope!)
MAMP recalcitrance
MAMP is a solution for setting up a personal webserver. It's a Mac OS X package that gets Apache, MySQL, and PHP running in simple fashion. Just add Drupal for a complete site development environment on your local machine.
I normally work on hosted Drupal sites from start to finish (or from start to abandonment, as the common case may be). But my web host performance was getting progressively worse during recent months, and at one point I brought my in-progress e-commerce site home to MAMP.
Even then, the site was later acting screwy in sundry ways (pages not loading, menu items going missing, much more). I decided to nuke the database and restore from an export I'd fortunately made a while earlier, after a previous troubleshooting gauntlet had ended and things seemed to be working.
So I head off to phpMyAdmin, drop all tables in the database (creating an empty shell), and go to import my earlier exported database – but what's this? MAMP's phpMyAdmin won't import a .zip file? ("You attempted to load file with unsupported compression (application/zip). Either support for it is not implemented or disabled by your configuration.", it whines.) Huh. Who knew?
Well, that should be no problem! Just unzip the file... which ballooned from a svelte 1.6 MB .zip file to a zaftig 22 MB .sql file. Yikes, too big? I wouldn't think so; the file import prompt in phpMyAdmin carries a side note, "(Max: 32 MiB)". No problem, right?
Wrong. Problem. The import choked partway through, with this message: "#1153 – Got a packet bigger than ‘max_allowed_packet’ bytes". Oh.
I found a solution in online discussions, including this one: http://forum.mamp.info/viewtopic.php?f=2&t=6306 . In short:
- To increase "max_allowed_packet", find the file /Applications/MAMP/Library/share/mysql/my-small.cnf .
- Make a copy of it in /Applications/MAMP/db/mysql/ , and rename the file my.cnf .
- Within my.cnf, look for the line beginning "max_allowed_packet = " , and crank up whatever number you find there. (I boosted mine from 1M to 32M, and that did me just fine. On my next attempt, phpMyAdmin imported the big sql file.)
Incidentally, this is no place to discuss MAMP in detail, but as a couple of other very general troubleshooting tips for beginners: Mysterious problems may be related to files or folders within MAMP with restricted permissions; fiddle with permissions if you must. And when otherwise in doubt, try simply stopping and restarting the servers from within MAMP.
Web host blues
Back to my web host: For a long time, I was getting increasingly poor performance on my shared DreamHost server, to the point I sometimes simply couldn't work on Drupal sites – and whatever the good points of the service, that problem obviously makes the whole deal unacceptable. I worked with support a lot, but it always boiled down to my Drupal sites demanding more memory than the shared server could offer.
In the end, while I flirted with changing hosts, I bit the bullet and decided to at least try DreamHost's Private Server service. It's an extra cost, but at the minimum level of service, still reasonable. I was dismayed for the first couple of weeks, though, as my sites' server usage was still ridiculously high, especially in terms of memory usage. But through some combination of my hamfisted tweakings and (possibly) optimizations made by DH, things have calmed down to a VERY stable and responsive level, under which my main server's memory usage is safely about 2/3 my limit, and my MySQL server's memory usage is about 1/3 my limit. (Both servers' CPU usage barely registers.) Not bad for a dozen or so Drupal sites (though, admittedly, not yet high-traffic sites)!
So I'm staying with DreamHost under my current, happy Private Server environment, and continue to recommend the service to the newbie or general Drupal user. While it's not a dedicated Drupal host and quite likely not up to the needs of pro sites, for the more casual Drupalist, the ability to host any number of sites with any number of databases, at no extra cost, is a great deal.
Hello! I just would like to give a huge thumbs up for the great info you have here on this post...
I may not have a chance to test that for a while, but meanwhile I welcome commentary from anyone...
Hey,
Since I still see some links here, and the guide is quite good, I thought that I may...
Nice article i like the way you thoroughly wrote it.