Using Magento CE on Go Daddy Shared Hosting

I recently installed Magento Community Edition on a Go Daddy shared Linux server, and I ran into a few problems that I thought I would share in case anyone else has the same issues.

Making the Installation Work

After uploading all the files, the first problem you may run into is that the installation wizard doesn’t work. Instead you get a blank page with the words “No input file specified.” You will need to make a couple changes to your .htaccess and php.ini files to get past this.

First, uncomment line 12 of .htaccess (remove the #). It should look as follows:

############################################
## GoDaddy specific options

Options -MultiViews

## you might also need to add this line to php.ini
##     cgi.fix_pathinfo = 1
## if it still doesn't work, rename php.ini to php5.ini

Next, rename the php.ini.sample file to php5.ini, open it, and add the following to a new line at the very end (as suggested in the .htaccess file ):

cgi.fix_pathinfo = 1

Upload these two files, but hold on — there is still one more step before you can install. Log into your Go Daddy hosting control panel, and click the “File Extensions Management” icon in the “Settings” section. You will need to change the .php and .php5 extensions to run under PHP 5.2.x (not the FastCGI option).

Go Daddy file extensions menu

After these changes, you shouldn’t have any problems getting through the installer. However, if you’ll be using Go Daddy’s preview DNS feature to view your website before changing DNS records, there are a few more things you need to do.

Using Go Daddy’s Preview DNS Feature with Magento

During the installation, you will be asked for your site’s “Base URL.” Enter http://yoursite.com.previewdns.com/ (or whatever your preview DNS URL happens to look like). Installation should finish without problem, but when you try to log into the admin panel, you’ll see that it’s a no-go. No error, no warning, nothing — it will simply show the login dialog again. This has to do with how Magento sets cookies for the admin panel, and to fix it, we need to temporarily comment out some code. Open the file at /app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. Around line 94, you should see the following:

if (!$cookieParams['httponly']) {
    unset($cookieParams['httponly']);
    if (!$cookieParams['secure']) {
        unset($cookieParams['secure']);
        if (!$cookieParams['domain']) {
            unset($cookieParams['domain']);
        }
    }
}

if (isset($cookieParams['domain'])) {
    $cookieParams['domain'] = $cookie->getDomain();
}

Comment out this section, save the file, and upload it.

/*
if (!$cookieParams['httponly']) {
    unset($cookieParams['httponly']);
    if (!$cookieParams['secure']) {
        unset($cookieParams['secure']);
        if (!$cookieParams['domain']) {
            unset($cookieParams['domain']);
        }
    }
}

if (isset($cookieParams['domain'])) {
    $cookieParams['domain'] = $cookie->getDomain();
}
*/

Now, you should be able to access the admin panel. You’ll see a warning at the top, complaining about a {{base_url}} setting. This is what prevented you from logging in earlier. Go to System > Configuration from the main menu, and click the “Web” tab in the left sidebar. Expand the “Unsecure” section and change the “Base URL” value to the same preview DNS URL you entered during the installation. You can leave the other “Base…” settings alone. Next, expand the “Secure” section and make the same change to the “Base URL” value. Save your changes.

Magento Base URL configuration menu

Everything should be working now, but remember to uncomment the code in Varien.php. If you have any problems with or comments on your experience with Go Daddy and Magento, please leave them below.

Updates

Here are a couple more problems I came across and how to fix them.

Unable to Insert Uploaded Image into Content

If you get a “target element not found for content update” error when trying to insert an image, it has to do with Magento setting the wrong domain cookie for Go Daddy’s previewdns.com URL. Magento checks the HTTP_HOST server variable when it should be checking for HTTP_X_FORWARDED_HOST first. As a quick fix, open /app/code/core/Mage/Core/Controller/Request/Http.php and change this:

public function getHttpHost($trimPort = true)
{
    if (!isset($_SERVER['HTTP_HOST'])) {
        return false;
    }
    if ($trimPort) {
        $host = explode(':', $_SERVER['HTTP_HOST']);
        return $host[0];
    }
    return $_SERVER['HTTP_HOST'];
}

to this:

public function getHttpHost($trimPort = true)
{
    if (!isset($_SERVER['HTTP_HOST'])) {
        return false;
    }
    if ($trimPort) {
        if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
            $host = explode(':', $_SERVER['HTTP_X_FORWARDED_HOST']);
        } else {
            $host = explode(':', $_SERVER['HTTP_HOST']);
        }
        
        return $host[0];
    }
    return $_SERVER['HTTP_HOST'];
}

Note: any upgrades will probably break this code, but as the preview DNS URL is a temporary measure anyway, it shouldn’t be an issue.

Uploaded Images are Broken on Front-end

If uploaded images aren’t showing up on the website, try deleting the .htaccess file in your /media/wysiwyg folder. Simple as that.

Information and Tutorials for Popular Content Management Systems

This post is just a quick reference for information and tutorials about common CMS’s. I’ll try to update it as I have time.

DotNetNuke

Drupal

Joomla

Kentico

SilverStripe CMS

Sitecore

WordPress

What’s New in Ektron 8.6?

Ektron 8.6 was released on June 28, 2012, without much fanfare. I did a quick Google search but was hard pressed to find much about it. So, I’ve decided to post my own findings, based mainly on Ektron’s product release notes and from my own quick installation and testing.

This is not an extensive review of all of the updates in 8.6 — but more of an overview of some of the major changes.

Adaptive Image Resizing for Mobile Devices

Responsive images for mobile devices have been gathering a lot of attention lately, and fortunately, Ektron is now offering the ability to serve up images based on the user’s screen size. Unfortunately, it relies on device detection to do so, but as there is no real standard yet for handling this problem, I commend them for taking the time to implement this useful feature.

Ektron has been trying really hard to be a leader in the CMS mobile market, and changes like this help to reinforce their dedication to that position.

New WYSIWYG Editor

I’ve never been a fan of Ektron’s default WYSIWYG editor, so I’m glad to see them moving toward third-party alternatives, such as Aloha Editor. Aloha is a great editor, especially when editing content in-line, and is a huge step forward. Personally, I’m relieved that I won’t have to deal with that annoying bug where <p> tags are removed when only one paragraph appears in content.

Improved Search

Microsoft FAST is available as a search provider, and popular features such as “did you mean…” and auto-suggestions are now included as well. Each new Ektron release tends to focus very much on search improvements. In the future, however, I would like to see a little less attention paid to this area. Although better search results and features are nice, I rarely hear complaints from clients about how slow the search is or how they wish the results were more accurate. Maybe that’s just me, though.

New URL Aliasing Options

In addition to the automatic and manual URL aliasing features, you can now use improved regular expressions to determine the URL structure. There are also options for managing URL redirects — very helpful when a URL needs to be changed.

Other Updates

Version 8.6 also offers three more templated server controls (Content, Menu, and Access Point), updates to eSync, and a ton of bug fixes. Overall, this doesn’t seem to be a major update unless you’re sick of the eWebEditPro editor or have a vested interest in regex URLs or serving up mobile-optimized images, but there appears to be some clean-up going on, and I think Ektron is heading in the right direction by placing more emphasis on mobile devices and making it easier on authors through third-party WYSIWYG editors.