PHP Script Installations Suck

Jul
31
2006

After the hundreds and hundreds of PHP scripts I've installed over the last 6 years or so, one thing has become abundantly clear: PHP script authors write scripts that absolutely suck to install (yes, I'm guilty too). What's strange is how often the sucky installation actually *includes* an installation procedure yet the user still ends up doing the exact same song and dance as if there hadn't been one. That would be OK if it wasn't easily within reach to make these things simple.

As more and more people start using PHP scripts, they are being installed by non-geeks. Regular folks are getting into web publishing and blogging. Having to load an SQL statement from the commandline is NOT a reasonable thing to ask a non-technical user to do. And, it's actually not a terribly reasonable thing to make anyone do. Scripting the exact same thing (load this .sql file into this database) takes no more than about 10 lines of code.

So, here's my PHP script installation solution and suggestions. I didn't write it out in code because it still does require implementation in each script. However, paying attention to these concepts will dramatically improve your PHP script installation process.

What's Required for a Typical PHP Script:

  • A place to store configuration information
  • The actual configuration information
  • An initial load of data into a database
  • A way for the rest of the script to know whether the installation has already happened and a way to trigger the install if not.

What's Required to Make it Easy:

  • Minimal changes to the filesystem.
  • Robust handling of errors when things don't go right
  • Ask the user for the bits that they need to provide.
  • Parse out and prepopulate anything that can be fetched directly from the environment.
  • Never make the user do anything that can be done directly by the script itself.
  • Uploading a new version over the top of an installed version should NOT overwrite configuration settings.

Basically, all someone should have to do is upload the script, make sure that the one place on the filesystem is writable and the rest should happen via the browser by hitting the script's URL.

Making Cinnamon Ice Cream

Jul
30
2006

It's freaking hot and that particular refrain isn't exactly unique across the country for the last couple of weeks. This particular weekend, I called in "It's too hot" on the painting and made cinnamon ice cream instead. Served up with some graham crackers and a bit of caramel sauce and a few Heath chips on top and it's a perfect antidote to the summer. Of course, these things need to be in moderation, but, from the stat I heard recently that 93% of Americans eat ice cream (making it the most popular food in the country), its a refuge that I doubt I'm alone in seeking this weekend.

I made it in the $18 ice cream maker I picked up a few weeks ago on a Target endcap and used the basic Ben and Jerry's recipe:

  • 2 eggs (I use pasteurized to avoid excess cooking and still stay foodsafe)
  • 3/4 cup of sugar
  • 2 cups of whipping cream
  • 1 cup of milk

To that I just added a teaspoon of cinnamon and ran through the normal process, throwing it into the freezer to firm up. My plan for later this summer is to try to recreate the oatmeal cookie ice cream that Ben and Jerry put out as then I'd reach frozen dairy nirvana.

Heading Up North to the Lake

Jul
27
2006
Nicely browned

It's been in the works for months now, but the deal has the kinks worked out and Shelly and I are buying a lot in a vacation spot up near Mille Lacs. It's not actually on the lake (would cost WAY too much), but is about a 1/4 mile away. It's a deeded lot with a travel trailer on it as a cabin. We'll likely be putting in a second one for more living space up there and my parents have already put in a firepit, etc. The community has facilities including a pool, game room (and I won't be at anyone else's mercy for quarters up there as an adult), convenience store, some food, etc.

The lot itself is isolated and quiet and ideal for the kind of vacation my family has always been more into: sitting around the fire at night, reading a book in the shade during the day, a little fishing here and there, a little BBQ, and just relaxing. Before buying this, my parents usually did something similar in another facility with a popup camper and usually head out for 3-4 weeks at a time.

It's about 2 hours "up north" (it's a Minnesota thing) without traffic, which is far enough to get away, but close enough for weekend getaways. I like the area and am definitely looking forward to getting time away without it being a full-blown vacation. We'll be heading up for a day next weekend and some longer time later in the summer/early fall.

I'd like to head up there in early October, which, besides being my birthday week, is my favorite time of year and look forward to watching the leaves turn from a hammock.

Oh, I also hope that I don't get any cellphone reception up there. Then I can't be faulted by anyone for shutting it off.

Electric Sports Car, Hybrids and Electric Transportation

Jul
24
2006
Roadster

While I saw the original article earlier this week, Treehugger posting about it ended up with a much cooler picture of the new electric roadster that's the subject of a lot of buzz this week. While I thought it was cool on the same level as the rest of the conversation, it reminded me of something I wanted to write more about and that's how this roadster, other electric cars and hybrids all fit into the future of electric transportation.

Almost all of the discussion about this car and about hybrids like the Prius as well as about things like hydrogen cars center on the immediate practical rollout to *everyone* at once.

That approach completely misses the point and how these will fit into the longterm timeline of transportation.

See, in order for a technology to take hold on the same widespread level that internal combustion motorized transportation has in the last 100 years, you need parts and systems in place that can be dropped in without having to do R&D on every little thing. For instance, if you want to build a new gas-powered car today, you don't need to invent fuel injectors, disc brakes, steel belted radial tires, etc. And, if you were looking to build said car relatively cheaply, you could just order the parts off the shelf from existing manufacturers.

When you can get the core components off of the shelf, you can expend most of your energy on the aggregated device you're building. That's the exact approach of the recent DIY solar generator project listed on MAKE took, resulting in a backyard kilowatt solar generator for a couple of thousand bucks. The whole thing is based off of basic plumbing and automotive supplies and doesn't require the creation of a whole new manufacturing sector just to enable the rollout. Thus, when putting those solar generators out into rural areas, they can tap into the already abundant supplies and hit the ground running.

This electric roadster exemplifies this fact in that it is using thousands of battery cells originall designed for laptops. This allowed them to spend time developing the motor, etc. instead of having to do R&D on new batteries.

This whole benefit multiplies when dealing with things that are powered by electricity. That's because electricity is an abstract method of transporting energy. It doesn't matter how you generate it, store it or move it around, it's still electricity. That means that once a class of devices runs primarily on electricity, you can swap out the individual bits in the power delivery chain and it doesn't mess with the whole system.

Thus, if the actual motor, transmission, air conditioning, etc. are all based on electricity, it doesn't matter where that electricity comes from. It could be from a coal power plant, biodiesel generator, gasoline motor, solar panels, wind turbines, hydroelectric, nuclear or 450 raccoons on treadmills. If a new type of super-efficient battery suddenly becomes available, it can be swapped out without changing the rest of the components. If a cheaper way of charging those batteries becomes available, the source can be swapped out easily.

Compare that with transportation that requires a specific formulation of gas and *maybe* ethanol. It's not like you can just switch to solar should gas spike to $9/gallon. I have much the same problem with natural gas heat. Should natural gas go up 10x in price, I'd have to do a complete retrofit of my furnace to survive the Minnesota winter. As a result, at some point, I'll be putting in a hybrid furnace that is both electric heat and natural gas, where it can be switched. I will then be able to use whichever heating method is most efficient and cheapest at any given point.

This is the big benefit to the current crop of hybrids and experimental electric cars. I don't believe that we'll be driving gas/electric hybrids 30 years from now. However, they'll be a critical stepping stone on the path to what we really *will* be driving then. These hybrid solutions give us the bridge to those future implementations.

Painting The House

Jul
23
2006

I'm inside in the air conditioning on a quick break from the activity that has consumed my weekends, spare time and residual energy for the last couple of weeks and will likely do the same for weeks to come: painting my house.

When we bought last spring, the inspection said that things were fine as long as we painted within the first year or 2 of moving in. So, here we are, smeared with exterior paint, on a first name basis with the people in the paint department at Home Depot and in command of the exact cost of 5 gallon buckets of paint, brushes, buckets and rolls of blue tape.

We're also at that point in the project where I start getting that irrational urge to dig for my checkbook and throw several thousand dollars at the first contractor I can find. I'm fighting that urge. I understand how it's a rationally good idea for me to be doing this myself. But, standing on a 15 foot ladder as the sun traces across the side of the house toward my position, I feel like the guy in the desert who'd pay $500 for a glass of water. That somehow the sun has bleached all rational decisionmaking ability from my brain.

That's why I'd like to thank Willis Carrier (inventor of modern air conditioning) and the people in charge of putting Coke Zero for saving me thousands. The cool air and cool drink have restored the function of my cerebral cortex and I will be returning to my paintbrush and ladder after hitting "publish".

« Older Entries  

J Wynia

For better or worse, I'm the guy who runs things here. I'm a web consultant, software developer, writer and geek from Minneapolis, MN. This site is a fairly wide cross-section of the things I'm interested in and enjoy writing about.

Oh, and if you happen to be looking for hosting for your Subversion repositories or just web hosting in general, take a look at Dreamhost. It's what I use for Subversion and your signup helps me out.

Latest Microposts

jwynia: is ripping the first DVD on the new Thinkpad. Holy crap this DVD drive is quiet and smooth. No jet engine takeoff.
jwynia: is unsubscribing to a bunch of mailing lists that he's been deleting without reading for WAY too long.
jwynia: @bethdean if I ever get to the point of having an office and staff for my consulting, there WILL be a microwave popcorn ban.
jwynia: is wondering whether his intent to spend his stimulus check in Ireland is weird.
jwynia: is baffled by what a hot commodity the screen-cleaning spray has become in this office.
Follow Microposts on Twitter | Subscribe to Microposts

My Attendance At the Gym

Feeds and Links


www.flickr.com
This is a Flickr badge showing public photos from J Wynia. Make your own badge here.

Search


Pages

Archives

© 2007 J Wynia. All original content is licensed under the terms of the Creative Commons Attribution license unless otherwise noted. Content from other sources is licensed under its original terms.