Monthly Archives: July 2009

Update 2/22/2010: It looks like changing .htaccess is no longer necessary. After you select PHP 5.x, your site will begin using version 5.2.5 without any further configuration.

The following applies to older domains. As of early 2009, newly purchased linux hosting plans are running PHP 5.2.8, while older plans, once updated, only go up to PHP 5.2.5. I’ve had Ardamis.com hosted at GoDaddy since 2005, and quite awhile ago I thought I had upgraded to PHP version 5 from 4.3.11, but tonight I happened to check with phpinfo and found I was still on version 4.

In the unheard of ten minutes that I was on hold waiting for technical support, I figured out how to really run my pages on PHP 5.x (in this case, 5.2.5).

Log in and go to your Hosting Control Center. You must be running Hosting Configuration 2.0 to go any further, so if you haven’t touched your domain in years, do that first.

Click on Content, then Add-On Languages. Next to PHP Version, select PHP 5.x and click Continue. You’ll get a message that “Changing to PHP 5.x may make your PHP files run incorrectly.” Highly unlikely these days, but OK, you’ve been warned. Notice, too that it says “PHP 5.x will be activated“. Click Update.

It may take awhile for this change to be processed by the server, but once your Account Summary is displaying PHP Version: 5.x, it’s time for the really important part.

You see, you’ve only made PHP 5.x available at this point. Your *.php files are still running in 4.x. Go ahead and check phpinfo again.

Now, you could simply edit .htaccess to change the extensions, like so:

AddHandler x-httpd-php5 .php
AddHandler x-httpd-php .php4

More details at http://help.godaddy.com/article/1082

But if you’re squeamish about changing .htaccess yourself, there’s another way to set 5.x to be the default handler for *.php files. All the following does, strangely enough, is to add the AddHandler x-httpd-php5 .php to the beginning of your .htaccess file.

Back in the Hosting Control Center, click on Settings, then File Extension. If the change to 5.x has been completed, you’ll see at the bottom of the available extensions list, “Extension -> .php | Runs Under -> PHP 5.x” If it’s not there, stop here and come back in an hour or so.

Click on Custom Extensions at the left. This should be empty, with a message stating “No custom extensions have been created.”

Click on Default Extensions and then click on the Edit button (it looks like a piece of paper and a pencil) to the right of .php | PHP 5.x. Click on Continue.

Click again on the Custom Extensions button on the left, and you should now see “Extension -> .php | Runs Under -> PHP 5.x”. Check your phpinfo page one more time, and it should report PHP 5.x.

It’s unfortunate we even have to do this for our older domains, but I asked the tech support guy if I could somehow get on to PHP 5.2.8, and he said nope, that the newer servers have the more recent version but the older servers are stuck back in 2007.

A friend who does a lot of selling on eBay asked me to develop a web application for generating HTML templates that could be copied and pasted into his auctions. He wanted to be able to add a title, a description, and some terms and conditions, and also to be able to upload images so the auction template would display thumbnails that could be clicked to display full-sized versions in a new window or tab. The more we talked, the more it sounded like something that would be both useful for a good number of people, and potentially a source of ad revenue for us. And so was born Simple Auction Wizard, an online HTML template generator for auction websites like eBay.

I was looking for just this kind of a project because I wanted a reason to play with TinyMCE, an Open Source, platform independent, web-based JavaScript HTML WYSIWYG editor control, and SWFUpload, a small JavaScript/Flash library that does very neat things with file uploads.

The most difficult part was actually getting the templates to look good in a variety of browsers. Because the template HTML appears inside of a larger page, I couldn’t rely on Doctype switching to place IE into standards mode. This meant the templates would have to be developed so that they would look approximately the same in standards-compliant browsers like Firefox, Chrome, and Safari, as well as horrible browsers like IE6 in quirks-mode. I tried very hard to minimize the use of tables, but they eventually crept in. I was able to use CSS, for the most part, though if any more issues come up, I’m going to throw in the towel and just do inline styles.

The web app is open to the public, but realize that it’s very early in its development and I intend to continue making changes.

I completely hosed a few SanDisk Cruzer Micro USB 2.0 2 GB Flash Drives at work when I deleted the original contents of the drives, installed the CruzerPro software that had shipped with some older Cruzer Professional drives, and then used the CruzerPro application to password protect the drives. This process rendered the drives completely unusable and unable to be formatted.

The problems

Clicking the drive letter in Windows Explorer returns the following error message:

Please insert a disk into drive X:.

Attempting to format the drive returns the warning:

There is no disk in drive X.
Insert a disk, and then try again.

This is what the drives looked like once I’d thoroughly broken them.

SanDisk U3 Cruzer Micro USB Device Properties

SanDisk U3 Cruzer Micro USB Device Properties

The drive properties show:
Type: Removable Disk
File system: Unknown
Used space 0 bytes
Free space 0 bytes
Capacity 0 bytes

The Volumes tab shows:
Type: Removable
Status: No Media
Partition style: Not Applicable
Capacity: 0 MB
Unallocated space: 0 MB
Reserved space: 0 MB

Opening the Disk Management component of the Computer Management console shows that the drive is connected, but there is no unallocated space to partition or format.

Other things about the disk look normal. It shows up in the Device Manager as working correctly, without any warnings, for example.

I Googled around and found that many, many people were running into this problem where the drive starts reporting 0 bytes capacity and can not be formatted. Of the dozens of pages that I read, no one found a fix for the problem. The most common solution offered was to return the drive to the manufacturer for replacement. Well, I wasn’t going to publicize my mistake and return the drives, I was going to repair them.

Software that didn’t help

Feel free to skip this part if you’re not interested in reading about the many dead-ends I explored.

I knew of one nifty program that had helped me out a few times before, so I tried running the HP USB Disk Storage Format Tool v2.1.8, but attempting to format the drive with this utility returned the following error message:

There is no media in the specified device.

Someone suggested using this thing called “Apacer Repair v2.9.1.1” to reformat the drive, so I tried that, but the software only reported “USB Flash Disk not found!” when I ran it.

Someone else recommended FreeCommander, but that failed to open the drive, too.

I tried the free trial of the utility from http://www.flashmemorytoolkit.com/, but it reported the same information as Windows XP – that the device contained a disk with 0 bytes capacity. Maybe the full version could have done more, but I put that on the back burner.

A number of people suggested attacking it with partitioning software, which I wasn’t looking forward to doing, but was willing to try.

Another last resort was going to be using the Windows XP Recovery Console’s fixboot and fixmbr commands, which got me out of a pinch when I screwed up a partition.

What I should have tried to begin with

Then I had an idea. I had a clean drive that had escaped my earlier bungling. I plugged it in, copied the contents to my desktop and tried to run the U3 LaunchPad software. Nothing happened, so I started looking more closely at the files. One of the files was called SanDiskFormatExtension.dll, which sounded promising. Now I just needed to figure out how to run the SanDisk installer to reformat the drive. I tried all of the .exe’s and .msi’s that shipped with the drive, but nothing wanted to run from the folder on my desktop.

Just as I was running out of options, I opened the autorun.inf file and found a very interesting entry:

[Update]
URL=http://u3.sandisk.com/download/lp_installer.asp?custom=1.6.1.2&brand=PelicanBFG

The fix

So, with nothing to lose, I pasted http://u3.sandisk.com/download/lp_installer.asp?custom=1.6.1.2&brand=PelicanBFG into Internet Explorer, thinking that it would at least get me some new files that might allow me to reformat the drive. I followed a few prompts and lo, the U3 Launchpad Installer software launched and restored the drive to its factory settings of 2 GB capacity formatted as FAT. It even replaced the original U3 files, making it truly good-as-new.

I’m astonished that this information isn’t more widely available, particularly on the SanDisk support site and forums, as this 0 capacity problem seems to affect a good number of drives and there are many threads where this issue remains unresolved.

Note that the page at http://u3.sandisk.com/download/lp_installer.asp?custom=1.6.1.2&brand=PelicanBFG requires you to install an ActiveX component, so you must use Internet Explorer.

Otherwise, you can download the latest version of the U3 Launchpad Installer executable from the Sandisk KB.

Of course, if you’re not using a SanDisk drive, it’s rather unlikely that this software will fix your drive, but maybe your device’s manufacturer has something similar. There are also a number of good ideas in the comments below, so definitely read through them for more options.

If you’re trying to restore the drive’s contents or recover files, the all of the methods described on this page will format (erase) the drive and are not for you. Good luck.