Author Archives: blue

IIS 7 and 7.5 404 file not found, file exists

Recently moved a site from Apache to IIS that was using jwplayer with an .mp4 file as the video. Kept getting a permission or file not found error when trying to play the file.

Reason: mime type of .mp4 is not a part of the default IIS 7.5 mime types, so must be added.

Brief summary of steps to enable:

  1. Open IIS server manager in the administrative tools menu
  2. Select Mime Types
  3. Scroll down to be sure that .mp4 mime type is in the list
  4. Click add on the right side
  5. enter ‘.mp4′ and ‘video/mp4′ (no single quotes of course
  6. save

Refresh your page and try out the video. Should now work.

phpstorm6-load-screen

PHP Storm File Association

Jetbrains PHP Storm is an IDE that I love, the biggest pain about using it is that the uninstaller/installer when you upgrade from one version to the next puts the installation into a new folder, and it causes your files such as .php or .tpl to no longer associate with the phpstorm.exe file. Further, because of this you cannot associate them in the Windows -> open with -> choose default program dialogue as Windows simply will not put the program in the recommended programs or other programs list.

There are three workarounds for this that I am aware of, two of which I have tried successfully. I plan on trying the third way the next time I run an update of PHP Storm.

  1. Download a program that will automatically look for broken program associations. This one worked for me, and it cleaned up my PC a bit too:http://www.tune-up.com/
  2. Edit the registry. This is actually the quickest and easiest way:
    • Click on Start Menu
    • In search box type in ‘regedit’
    • Back up your registry (http://windows.microsoft.com/en-US/windows7/Back-up-the-registry )
    • Navigate to: Computer\HKEY_CLASSES_ROOT\Applications (not the .application one!!!)
    • Scroll down to PhpStorm.exe
    • Expand it to shell -> open -> command and you will see the folder that it opens under
    • Compare this to the new install of PHP Storm. If different:
    • Right-Click on the PhpStorm.exe in the registry editor and click on delete
    • Go back to the file you want associated with PHP Storm, Right-Click and select ‘open with’ – ‘choose default program…’
    • Ensure ‘Always use the selected program to open this kind of file’ and click ‘Browse’
    • Navigate to JetBrains -> PhpStorm 6.0 (or whatever folder Number) -> bin -> PhpStorm.exe
    • Program will now show up in the list of programs for other file types as well
  3. The final method involves the directory to which you install PHP Storm, and I haven’t yet tried this method. You should probably rename the install folder to simply ‘PHPStorm’ and not have a version number beside it, and always install into that folder. I have read that this method works, and I will be trying it next time I upgrade.

Hope this helps.

WordPress Permalinks web.config File Creation when there is a Permissions Error

When attempting to enable permalinks in Wordprss, you may come across the following message at the top of the settings-permalinks page after selecting a common settings style:

You should update your web.config now

Followed by this message below the ‘Save Changes’ button:

If the root directory of your site were writable, we could do this automatically, but it isn’t so this is the url rewrite rule you should have in your web.config file. Create a new file, called web.config in the root directory of your site. Click in the field and press CTRL + a to select all. Then insert this code into the web.config file.

All this means is that the root directory for your site is not writable, and WordPress has just attempted unsuccessfully to create the new file called web.config. This is a good thing, and means that the root folder permissions on your server are at a more secure setting.

To get permalinks working, follow the steps outlined above or:

  1. Open notepad (windows)
  2. Copy and paste the code block from WordPress into the new notepad document
  3. Click File -> Save
  4. Select ‘All Files (*.*) from the Save as type drop-down menu
  5. Type in ‘web.config’ and remove the .txt
  6. FTP this file to the root folder

One last thing, click on ‘Save Changes’ in WordPress after selecting the type of permalinks you want. A Second message will appear:

If your web.config file were writable, we could do this automatically, but it isn’t so this is the url rewrite rule you should have in your web.config file. Click in the field and press CTRL + a to select all. Then insert this rule inside of the /<configuration>/<system.webServer>/<rewrite>/<rules> element in web.config file.

Ignore this message, permalinks will already be working. Visit you blog and click on a post heading to see the permalinks in action!

This is current as of WordPress 3.3.1.

How to properly apply Mobile Browser Telephone Number Detection

While building a mobile browser website today, I came across a strange problem on my iPhone. I was building a real estate website which had the clients phone number on the page, and it had listing addresses which if they were of the right length (7 or more digits) Safari was converting them to phone number links.

Here is the original code, first is the telephone number, second is the address:

<div id="call-portrait">555-123-4567</div>
 
<p>111-1234 Main Street Vancouver, BC</p>

A quick search for how to disable telephone number detection in mobile browsers offered me the following meta-tags (first one is for iOS/iPhone, second is for Blackberry):

<meta name="format-detection" content="telephone=no">
<meta http-equiv="x-rim-auto-match" content="none">

After I applied this code addresses were no longer links, but neither was the clients’ telephone number. Further searching turned up an HTML method of inserting telephone numbers into code that I was not aware of which is similar to the mailto format:

<a href="tel:555-123-4567">555-123-4567</a>

So wrapping text or an image inside to that tag turns the telephone number into a usable link. The one drawback, not that it seems to be a real problem as there are already telephone number harvesters out there, is that this method provides a more efficient way for said harvesters to obtain phone numbers from your website.

Sources:

http://www.mobilexweb.com/blog/click-to-call-links-mobile-browsers

http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/PhoneLinks.html

http://mobiforge.com/forum/starting/dotmobi-best-practices/risks-using-a-hreftelxxxxx-links-0

Annoying Beep Sound from Laptop after Wakeup from Sleep

Every time my laptop would wake up from sleeping an annoying beeping, high pitched tone or squeal would sound whenever a sound played. This happened when clicking between pages or menus, watching a youtube video and eve)n during the shutdown music.

For a while I just avoided letting the laptop go to sleep, rather I would just put in the effort to shut it down instead of walking away and letting it put itself to sleep.

Being the type that is always looking to make life easier, I decided to search for a fix. Google basically turned up empty. There was a fix that involved device manager -> non-plug and play drivers (view -> show hidden devices), and changing the properties for the ‘beep’ link here. There was also a few brand specific fixes, but nothing worked.

About ready to give up hope, I decided that there must be a simple solution to this annoyance which must be built into Windows or my Asus laptop’s hardware for a reason. Well it took about 5 clicks and it was fixed. Here’s the solution:

Control Panel -> Sound -> Playback tab -> Right-Click Speakers -> Advanced tab -> Default Format drop-down -> selected a higher rate like 24 bit, 44100 Hz (Studio Quality)

Clicked on test = annoying beeping high pitched sound gone!

This is the third time I have come across frequencies playing a roll in squealing sounds from computers or monitors, so this is obviously something that should be investigated.

Hope this helps.