Archive for October 30th, 2010

I have been tinkering with Android App Inventor a little recently, and have it set up and running on my main laptop at home.

I often work nights and have a second laptop I sometimes take with me, and thought it would be good to get App Inventor up and running on it too, for those quiet late nights when I have nothing happening at work.

Since I’d already used this laptop to root my phone, I thought ‘No worries, all the drivers I need will be installed’.

How wrong was I!!  No matter how hard I tried, the blocks editor would not connect to the phone.

Ultimately, I had to remove everything that I’d previously installed HTC wise, and re-install just the App Inventor Extras Software. Once I’d done that and reconnected the phone, all was well.

I’d also had the Android SDK installed, which had it’s own copy of adb.exe to further confuse matters.

To be sure you’re using the right one, connect your phone, open a command prompt, and navigate to c:\Program Files\Android\appinventor-extras.

Type adb devices and you should see a list of devices attached. It’ll be something like

HT06SPL00260     device

If you don’t see that, then you’ll need to run through the the process here: App Inventor Setup.

It does work, just be sure to follow it exactly!!

PHP and IIS have not always got on. My last install was hand crafted, and took some time to get the way I wanted, with the extensions I needed etc.

So, I had the need to install PHP for a customer at work, on what was a new, effectively bare install of IIS, and things have improved somewhat.

After a bit of research, I discovered I needed the following:

1. PHP for Windows, found here: PHP for Windows. Recommended was version 5.3.3 VC9 non-thread safe installer. You may also need the Microsoft 2008 C++ Runtime, which is linked to from the same page.

2. Fast CGI for IIS, found here: Fast CGI for IIS. Follow the on screen instructions to install this.

Since it was a clean install, there were no previous versions involved, I simply installed the Microsoft 2008 C++ Runtime which was appropriate for my OS, installed FastCGI, and finally, ran the PHP 5.3.3 installer, selecting FastCGI from the list presented. I also left the installed extensions as the defaults, however you can opt to install more extensions if you so desire.

By selecting FastCGI, the installer will automatically add the .php extension globally to IIS, so any new sites you create will automatically get the .php extension.

Reboot if you need to, and once the server has restarted, create a file in the root of your default website called ‘phpinfo.php’, and edit it so it contains the following:


Using a web browser, visit the default site and specify the phpinfo.php file. If PHP is working, this will display several pages of information about PHP. If not, you’ll need to retrace your steps to see what might have gone wrong.

The most usual problem is that the site does not know what to do with the .php extension, so just check and make sure it matches the global one, and if it doesn’t exist for your site, you can add it using the global definition as a reference.

If you are upgrading, the procedure is much the same, except you must uninstall any previous versions before starting. This will mean your sites are down, so be sure to do it when it will have the least impact. I also took a backup of my old PHP directory as a reference before uninstalling

Also, although the global settings for the .php extension will be updated, you will need to check all your PHP enabled sites to ensure the .php settings match the global settings, or your sites may not work correctly.

That’s it. Not too difficult, just take your time and don’t panic!

The last item I had to move to my D: drive was my web root folder that contained all of my websites.

I moved all but the default website, since that contained my Outlook Web Access, and I was wary of breaking it. As with any procedure, make sure you have good backups, and since this is an IIS 6 procedure, ensure you are running IIS 6 before using it.

The actual procedure is quite simple, since we are simply moving directories, and pointing the websites at the new location. Before proceeding, ensure you’ve checked each site is working, and that you know the location of the folder that contains the sites files.

First things first, start a command prompt, and run the command ‘iisreset /stop’. This will stop all services relating to IIS, and means there will be no locked files to hinder you.

Once the command has completed, locate the folder containing the files for your website. For example, the folder containing the files for this blog were at C:\web\http\Wordpress.

I then copied the entire WordPress folder and its contents to D:\web\http\. The folder was now D:\web\http\Wordpress.

I then made sure the permissions matched those of the folder in it’s original location. i then restarted IIS from the command prompt, using the command ‘iisreset /start’.

I then went to the properties of the website in IIS Manager, and at the home directory tab, changed the path to point at the new location, and restarted just that site.

I then tested the site to make sure all was well before deleting the files from their old locations.

I then repeated for all my other sites. If you want, you can issue the command ‘iisreset /restart’ when you’re done, and this will restart the whole if IIS, just to be on the safe side.

So, next on my list of ‘Things to move to D:’, were the MySQL DBs that sit behind a couple of sites I’m tinkering with, plus the DB that sits behind this very website. I’m using MySQL 5.1, but if you’re using a different version, please check before using this procedure, and as always, if you can, take a backup.

The MySQL procedure is quite different to that used for MSSQL, as you will see.

Firstly, stop the MySQL service, because you won’t be able to move a thing if you don’t.

Once the service is stopped, locate the MySQL program directory, which was C:\Program Files\MySQL\MySQL Server 5.1 for my install.

In that directory, locate the file called ‘my.ini’ and open it in notepad. Look for the comment ‘#Path to the database root’ in my.ini, and the very next line should contain the current path to all your DBs.

Locate your DB’s using the path you’ve just found. Copy all of the folders to your new drive, in my case D:\MySQL, and make sure they have the same permissions as before.

Now, go back to ‘my.ini’ and comment out the line beginning ‘datadir=’ that pointed to your original DB path. The # is used to comment out lines in MySQL.

Create a new line beneath it, beginning ‘datadir=’ and add your new path to your DBs.

For example, the line I added was datadir=”D:/MySQL/”. Save the ‘my.ini’ file, and restart MySQL.

That should be it. Check all your DBs are working, and if not, roll back the changes and look at the event logs to see what might be wrong.

Once you’re satisfied everything is working, you can delete the old directory and free up some space.

Good luck!