osCommerce admin login won’t login

I’ve been implementing a new website using the WP.osC framework (based on osCommerce) and ran into a problem of not being able to login to the admin panel.  It would simply redirect back to the admin login page.  This typically occurred when I would change the URL to the store website.

Quite a few people had the problem but one person (Dan O’Brien from Cornwall, England) provided the solution that worked for me.

  1. Edit catalog/admin/includes/application_top.php
  2. Comment out the block of code below the comment that says:
    // redirect to login page if administrator is not yet logged in
  3. Log in to the admin panel
  4. Click on the Administrators link.
  5. Edit the administrator in question.
  6. Change the password.
  7. Uncomment out the block of code previously commented out.

Thank you Dan O’Brien!

Resources

Comments (1)

mysql_connect to localhost on Windows 7 and Windows Vista times out

I’ve been developing PHP websites against mysql on Windows Server 2003 and Windows Server 2008 R2 and finally decided I needed to start doing my testing and debugging on a client machine instead.  My development machine runs Windows 7 so it is running the same version of IIS as my Windows Server 2008 R2 machine.

As I was getting everything setup, I installed phpMyAdmin and immediately ran into a problem.  It would time out trying to connect to the database on localhost.  Of course, I didn’t know that at the time as phpMyAdmin just displays a blank page.  I found this article by Karina Myers that described a workaround – specify 127.0.0.1 for the host instead of local host.  Specifically, change this:

$cfg[‘Servers’][$i][‘host’]    = ‘localhost’;

to this:

$cfg[‘Servers’][$i][‘host’]    = ‘127.0.0.1’;

Then I proceeded to install an osCommerce website and it had trouble as well.  Fortunately I had Xdebug installed so I got some useful error messages.  I should have guessed this before; the problem had to do with the mysql_connect() function trying to connect to localhost.

Fortunately for me, others have run into this before and the solution was posted to the documentation page for mysql_connect.  Here is what you do:

  1. Edit the %SystemDrive%\System32\drivers\etc\hosts file.
  2. Make sure the following line is not present or is commented out:
    ::1         localhost
  3. Make sure the following line is present and is not commented out:
    127.0.0.1   localhost

Doing this solved the problem completely for me.

Update 12/29/2009

I discovered tonight that this tip also fixes a problem I was having with the Beyond TV web admin on Windows Vista. When attempting to connect from the local machine by right-clicking on the Beyond TV tray icon and selecting Open Web Admin the browser would display an error page. After making the above changes to the hosts file, all was right with the world again.

Resources

Comments (1)

WP Gallery Image Shortcode Plugin

I just released my first WordPress plugin – the WP Gallery Image Shortcode plugin.  This plugin lets you add an image to a post or page from the WordPress gallery on your site using a shortcode.  Normally when you add an image, it embeds an image tag and sometimes an anchor tag that each includes your site URL.  This might be fine for some sites, but if you ever need to move or copy content from one URL to another, these yet more places that you must modify to get that content working in the location.

I finally got tired of it and wrote this plugin.  It allows you to use a shortcode in your posts and pages that refer to uploaded images by ID, name, or title.  The easiest is probably by title since that is what is displayed in the admin panel.

The plugin is being hosted by the WordPress plugin repository.  Check it out and let me know what you think.

Resources

Leave a Comment

Tynt Insight

I stumbled upon a service that allows you to know what’s being copied from your site.  The service can add attribution to the copied text which can drive more traffic to your site.  The service is called Tynt Insight and the basic functionality is all free, but they offer additional features in a Pro package for a fee.

Here are some comics that describe some of the features.

 tynt-conversation-1

tynt-conversation-2

 

I’m trying this out now on my site.  I’d be interesting to hear what others think about it.

Related posts

Leave a Comment

PowerShell version of dir /s and the -Recurse parameter

My colleagues and I ran into a bit of a problem trying to find all the files that matched a pattern at or below the current folder.  The problem is that the PowerShell Get-ChildItem cmdlet has a bizarre notion of file and path matching.  Consider this cmd.exe command:

dir /s Microsoft*

This will return all the files that begin with the word Microsoft at or below the current directory.  You might think the following PowerShell command would do the same thing:

Get-ChildItem Microsoft* -Recurse

Well, guess again.  That returns all the contents of all the folders that begin with the word Microsoft.  Huh?  When do you ever need to do that?  Okay, maybe someone needs to do that sometimes, but for that to be the default is mind-boggling.  Try this instead:

Get-ChildItem -Include Microsoft -Recurse

This command does the same thing as the above cmd.exe command.  It’s rather bizarre why that isn’t the default when recursing, but at least there is a fairly low-cost way to do it.

Resources

Leave a Comment

Editing applicationHost.config on 64-bit Windows

I’m coming up to speed on IIS7 on Windows Server 2008 R2.  There is a lot to like, but there is also a lot to learn.  One of the things that’s interesting about R2 is that there is no 32-bit version, so I’m finally running 64-bit Windows.  This doesn’t come without its problems.

One of the problems I’m running down required that I view and possibly edit applicationHost.config.  This file is located at %SystemRoot%\System32\inetsrv\config.  Seems simple enough.  I was able to find it from the command line easily, but when I went to load it in my favorite editor (Notepad++) I got a file not found error.  Turns out that the System32 folder is redirected for 32-bit applications to SysWOW64.  There appears to be no way to view the System32 folder using a 32-bit app.  Go figure.

Fortunately, 64-bit versions of Windows ship with a 64-bit version of Notepad.  As much as I dislike it, at least it works.

Rick Strahl wrote a terrific article covering this issue, which I’ve listed in the Resources section.

Resources

Leave a Comment

Regenerating WordPress Thumbnails

I’m in the process of moving my WordPress sites to a new server and a new version of WordPress, and as part of that I’m also reevaluating how my uploads are organized. I discovered that some of my images didn’t have thumbnails generated in the right sizes.

Fortunately, I’m not the only person who has run up against this problem.  Alex, otherwise known as Viper007Bond, wrote a handy plugin called, appropriately enough, Regenerate Thumbnails. This plugin couldn’t be much simpler. After unzipping it into a folder below your plugins folder and then activating, go to Tools > Regen. Thumbnails and click the button.

Nice. Simple. Elegant.

Leave a Comment

“Location is not available” on Windows Server 2008

I’ve just recently added a Windows Server 2008 R2 machine to my network with a domain controller running Windows Server 2003 SBS.  Everything seemed to be working fine for a couple days (not sure why it lasted that long) when I started getting an error message like this:

The system detected a possible attempt to compromise security. Please ensure that you can contact the server that authenticated you.

Location is not available

A search on the Internet turned up a solution on Microsoft’s support website.  The article says that the KB content has been retired, but the solution worked for me.

The article says that the problem occurs because the network firewall filters Kerberos traffic.  The solution is to open up port 88 for both TCP and UDP.  This solved the problem for me.

Note that on previous versions of the firewall it was a LOT easier to open up a port.  On Windows Server 2008 R2, here is what you have to do.

  1. In Server Manager navigate to Configuration -> Windows Firewall with Advanced Security -> Outbound Files.
  2. Click New Rule.
  3. Select Port and click Next.
  4. Select TCP and Specific remote ports, type 88 for the port number, then click Next.
  5. Click Allow the connection and click Next.
  6. Select the network profile you want to allow this for then click Next.
  7. Type a name (such as Open Kerberos Traffic (TCP)), then click Finish.

Do the same thing for UDP and you should be done.

Resources

Leave a Comment

Copying a WordPress Blog to a Different Domain

Periodically I need to copy the contents of a log to another domain for testing purposes.  WordPress doesn’t make this particularly easy as it embeds the complete URL of the site in many places, including the options table, in the posts table for each post, and even in posts, such as when media is added.

There is no need to create the blog in the new database. If you’ve already done that, I would recommend deleting the tables before continuing.

Before you move on, you’ll want to back up your blog.  There are plenty of solutions for this, but a handy one that I’ve been using is WordPress Database Backup by Austin Matzko.

Now you can import the resulting backup file against the destination blog’s database.  I use phpMyAdmin for this, so here are the steps for doing that:

  1. Log in to phpMyAdmin.
  2. Select the destination blog’s database.
  3. Click the Import tab.
  4. Click the Browse button and find the .sql file that was the result of the backup operation.  If your backup produces a .zip or .gzip file, that will work fine also.
  5. Click the Go button.

You now have your content over on the new site, but you still have work to do.  You still need to change all references to the old domain to be the new domain.  There are three SQL commands you need to execute to do this.  To execute a SQL command, select the database in phpMyAdmin and click the SQL tab.  Paste the following commands into the edit box and change old-domain and new-domain as appropriate.  If you changed your table prefix, don’t forget to change the names of the tables as well.

First let’s fix the wp_options table.

UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

Now let’s fix the guid column in the wp_posts table.

UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');

Finally let’s fix the content in the wp_posts table.

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');

The final step will be to copy any files that were uploaded, such as in the wp-content\files directory.

Resources

Comments (1)

Troubleshooting on IIS7

I’ve been setting up WordPress on Windows Server 2008 R2 lately and as part of trying to understand the issues fully - by installing, uninstalling, installing, etc., the last time through I forgot to create the database and the SQL user for WordPress. Unfortunately, when I connected to my website, all I got was the following error page:

Internal_Server_ErrorNo matter how I modified my WordPress configuration file, I couldn’t get anything more to be displayed, and none of the log files (PHP or IIS) contained any additional information.  Turns out this is a security feature of IIS7 to prevent details of the web server (such as folder locations, etc.) from being displayed publicly.  The solution is simple, if somewhat obscure.

To get IIS to display more detailed information, you must run the Configuration and change a setting.  Here are the steps:

  1. From Internet Information Services (IIS) Manager (hereafter called IIS Manager), click on the website you are having trouble with in the tree view to the left.  If you click on the server, your changes will apply to all websites.
  2. In the Management section, double-click on Configuration Editor.
  3. In the dropdown list next to the Section label, select system.webServer –> httpErrors.
  4. Change the errorMode to Detailed.

It’s likely that the value of errorMode is set to DetailedLocalOnly, but this value doesn’t help for troubleshooting a WordPress site since IIS won’t consider your access local even if you access it from the machine running IIS.  Too bad really, since after you are done with your troubleshooting you will want to reset the value back to DetailedLocalOnly.

Resources

Leave a Comment

 Page 1 of 15  1  2  3  4  5 » ...  Last »