WordPress asking for FTP username/password?

Are you annoyed with your wordpress install asking you for your FTP cradentials everytime you try to upgrade a plugin? I know I was.  Thankfully, there’s a simple solution which will save the FTP login (username/password/server) so WordPress stops asking you for them.  Here’s how you do it.

  1. Locate your WordPress root diectory and find the “wp-config.php” file.
  2. Edit the file and insert this somewhere in the middle as it’s own block, we normally put it after the mysql username/password block.
define("FTP_HOST", "localhost");
define("FTP_USER", "yourftpusername");
define("FTP_PASS", "yourftppassword");

Once you’ve made that edit, save the file and voila! No more punching in your ftp username and password all the time.

timthumb.php returns a 404 Error in WordPress

timthumb is a great little php script that helps create thumbnail images (http://code.google.com/p/timthumb). I’ve used it before, but recently I purchased a wordpress theme that used it, and it wasn’t working.

I would get a 404 error when I tired to access the directly via a url like this:
theDomain.com/wp-content/themes/theTheme/scripts/timthumb.php?src=/wp-content/uploads/2010/05/moose1.jpg&h=207&w=237&zc=1&q=80

After some digging around in log files on my server I realized the error

SoftException in Application.cpp:610: Directory “/home/usernamehere/public_html/wp-content” is writable by others

My problem had to so with the directory permissions! “writable by others” means that the permission on the directory were set to “777”. I changed the permissions of the directory using chmod to 755, and everything started to work.

Lesson learned, if timthumb.php is not working at giving you 404 errors, check the permission of the directory that contains the php file.

SQL Server 2008: FIXED “Saving changes is not permitted”

Working in SQL Server 2008 I received this confusing error when editing the structure of a table:

“Saving changes is not permitted. The changes that you have made require the following tables to be dropped and re-created. You have either made changes to a table that can’t be re-created or enabled the option Prevent saving changes that require the table to be re-created.”

I tried many things but I kept getting this error. After some trouble shooting I found the following information:

This error happens because “Saving Changes is not permitted” when using SQL Server 2008 Management Studio to modify the structure of a table especially when SQL Server needs to drop and recreate a table to save the structural changes. It is always advised to make a structural change for a table using TSQL. However, it is a convenient option for database developers to use SQL Server Management Studio make such changes  as the  Prevent Saving Changes That Require Table Re-creation option is enabled by default in SQL Server 2008 Management Studio.

I can understand why this feature would be helpful to have but to have it enabled by default is just silly.

I found that you can disable this feature by:

  1. Open the Tools menu then click on Options
  2. Open the “Designers” tree
  3. Click on “Table and Database Designers”
  4. Uncheck “Prevent saving changes that require table-creation”
  5. Press “Ok”

Once I disabled the “Prevent saving changes that require the table re-creation” option,  I was ahead and save the changes I needed to make.

Remove Unwanted Firefox Auto-Suggest Entries

Firefox 3 is awesome we all know that, but there are some things that that would just be nice to have. One of those things would be the ability to control what appears for the auto suggest when you type in the URL bar.

Most of the time FireFox does a very good job of figuring out what you want to do, but when it goes bad, it goes really bad and gets annoying fast.

The other day I accidentally typed in “google.com/a”, and from that moment time on, everytime I wanted to go to “google.com”, it would auto complete to “google.com/a”, and i would end up going there. Very annoying.

I searched the Firefox menus but couldn’t find anything to help. I didn’t want to wipe out all of the auto complete entries, I find most of them helpful. I did some research and realized that you can remove these entries manually, but you have to do it in an unconventional way.

How remove those unwanted auto suggest entries

1. The list appears as you type something.
2. Select an entry by pointing you mouse at the item in the list, it will highlight.
3. Press Shift + Delete from your keyboard to delete the entry.

That’s all! You can remove entries from the address bar.  This trick works on any Firefox auto complete list, including text fields and other dropdown suggestions.

This also works on windows, mac and linux machines

SQL Server 2008: FIXED “Data has changed since the Results pane was last retrieved”

Today I was trying to edit the value in a table cell through the query browser in Microsoft SQL Server Management Itudio and I kept getting the following error:

Data has changed since the Results pane was last retrieved. Do you want to save your changes now?
(Optimistic Concurrency Control Error)
Click Yes to commit your changes to database anyway.
Click No to discard your change and retrieve the current data for this row.
Click Cancel to continue editing.

I would click “Yes”, and get another error:

No row was updated.
The data in row X was not committed.
Error Source: Microsoft.VisualStudio.DataTools.
Error Message: The row value(s) updated or deleted either do not make the row unique or they alter multiple rows(N rows).
Correct the errors and retry or press ESC to cancel the change(s).

I was killing myself trying to figure out what was wrong. I was the only person working on the database, so the data wasnt being changed behind my back.

After an hour on goolge I came across a Microsoft tech article for MS SQL 2005, http://support.microsoft.com/kb/925719

It stated the issue could occure from one of the following conditions:

  • The table contains one or more columns of the text or ntext data type.
  • The value of one of these columns contains the following characters:
  • Percent sign (%)
  • Underscore (_)
  • Left bracket ([)
  • The table does not contain a primary key.

I double checked the table I was working on and realized it didnt have a primary key. It must have gotten dropped in the data migration from MS SQL 2000 to MS SQL 2008. A simple right click, set primary key and my problem was fixed.

Verify the primary keys! It’s a simple fix to a head breaker of a problem. I hope someone finds this and it fixes their issue.