<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>rabidGadfly &#187; wordpress</title>
	<atom:link href="http://rabidgadfly.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://rabidgadfly.com</link>
	<description>Simple Solutions to Nagging Coding Problems</description>
	<lastBuildDate>Wed, 19 Oct 2011 13:43:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>WordPress Install/Upgrade Issues Linger in 2.6.2</title>
		<link>http://rabidgadfly.com/2008/09/wordpress-installupgrade-issues-linger-in-262/</link>
		<comments>http://rabidgadfly.com/2008/09/wordpress-installupgrade-issues-linger-in-262/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 15:45:37 +0000</pubDate>
		<dc:creator>rabidgadfly</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[wordpress installation]]></category>
		<category><![CDATA[wordpress upgrade]]></category>

		<guid isPermaLink="false">http://www.rabidgadfly.com/?p=78</guid>
		<description><![CDATA[Back in March I wrote a post detailing the issues I had upgrading to an earlier release of WordPress 2. One of the issues was that I use custom table prefixes and they weren&#8217;t being read correctly by the upgrade script. My solution at that time was to hard-code the table names into the script. [...]]]></description>
			<content:encoded><![CDATA[<p>Back in March I wrote a post detailing the issues I had upgrading to an earlier release of WordPress 2. One of the issues was that I use custom table prefixes and they weren&#8217;t being read correctly by the upgrade script.</p>
<p>My solution at that time was to hard-code the table names into the script. Since that time, I&#8217;ve upgraded the same blog to a newer version and all went well.</p>
<p>I saw the issue again when trying to upgrade from a pre-2.0 version. Once again, the prefixes were not being read correctly. Since this was a small blog so I decided to simply install a fresh version of WordPress and import the old posts, but I ran into the same problem with a fresh installation!</p>
<p>This time I realized that not only were the table prefixes missing but so was the database name. I looked into it a little further and found that the instantiation of the $wpdb global variable in wp-admin/includes/upgrade.php was not working correctly.</p>
<p>I&#8217;m not a PHP guru, but if I understand how this is supposed to work, $wpdb is responsible for retrieving the database name and prefix from the WordPress configuration and insert that information into the script.</p>
<p>I passed this information to a coworker of mine who is more knowledgeable in the ways of PHP and he suggested two things. First, to use error_log() to log the possible error and second, to use print_r() to output $wpdb to the screen before the sql scripts ran. This would give me a better idea of what the problem was by displaying the contents of $wpdb.</p>
<p>So, I placed the following statement on line 62 of upgrade.php, after the $wpdb declaration and just above its first use:</p>
<pre>
<code>
error_log($wpdb->terms);
print_r($wpdb);
</code>
</pre>
<p>As my coworker stated, the sql was dumped onto the page, but, strangely enough everything looked fine. There were no longer any errors!</p>
<p>It seems as if either the error_log() or the print_r() functions actually fixed the issue. My only guess is that $wpdb was not properly instantiated and one of the functions I used to troubleshoot actually instantiated it.</p>
<p>Obviously, this is not a problem with all WordPress upgrades and installations. Most people have had no issues at all, but I&#8217;ve seen enough posts out there to know that I&#8217;m not alone as far as the issues go. My best guess is that it has something to do with the installation PLUS my server configuration.</p>
<p>I&#8217;m using PHP 5 and my coworker informed me that the upgrade was done for PHP 4. Obviously, the code has to continue to cover PHP 4. I&#8217;m just wondering if there&#8217;s a glitch involving the PHP version and possibly the PHP server configuration that&#8217;s causing issues with the upgrade code.</p>
<p>-rG</p>
]]></content:encoded>
			<wfw:commentRss>http://rabidgadfly.com/2008/09/wordpress-installupgrade-issues-linger-in-262/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dean&#039;s Permalinks WordPress PlugIn</title>
		<link>http://rabidgadfly.com/2008/09/deans-permalinks-wordpress-plugin/</link>
		<comments>http://rabidgadfly.com/2008/09/deans-permalinks-wordpress-plugin/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 13:01:31 +0000</pubDate>
		<dc:creator>rabidgadfly</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[permalink]]></category>

		<guid isPermaLink="false">http://www.rabidgadfly.com/?p=73</guid>
		<description><![CDATA[Until last night, my WordPress permalinks were nothing more than the default of a URL variable containing the number of the post ( i.e. http://www.rabidgadfly.com/?p=49). I&#8217;ve been wanting to change to a more descriptive and search engine friendly URL but this would require a boatload of work. I ran into Dean&#8217;s Permalink Migration Plugin a [...]]]></description>
			<content:encoded><![CDATA[<p>Until last night, my WordPress permalinks were nothing more than the default of a URL variable containing the number of the post ( i.e. http://www.rabidgadfly.com/?p=49). I&#8217;ve been wanting to change to a more descriptive and search engine friendly URL but this would require a boatload of work.</p>
<p>I ran into <a href="http://wordpress.org/extend/plugins/permalinks-migration-plugin-for-wordpress/">Dean&#8217;s Permalink Migration Plugin</a> a while back which claimed to do all of the work for me. It looked promising and there were a lot of positive comments, but I had no luck changing my links.</p>
<p>Recently, I upgraded my WordPress installation and decided to give it another shot. I&#8217;m very happy I did! This time around the migration went flawlessly and took a total of 3 minutes.</p>
<p>All that&#8217;s required is to install the plug-in (copy it into your plugins folder), activate it, and follow Dean&#8217;s instructions:</p>
<p>   1. goto admin panel->options->PermalinksMigration and set the old permanlink structure.<br />
   2. goto admin panel->options->Permalinks and change the permalink structure to what you want.</p>
<p>That&#8217;s it! It really was that easy.</p>
<p>The plugin will even generate a 301 Redirect when user or spider visits your site using the old permalinks, and redirect them to the new permalinks of the same post. This means you lose none of the traffic from your existing search engine entries.</p>
<p>-rG</p>
]]></content:encoded>
			<wfw:commentRss>http://rabidgadfly.com/2008/09/deans-permalinks-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How I Fixed My Failed WordPress Upgrade</title>
		<link>http://rabidgadfly.com/2008/03/how-i-fixed-my-failed-wordpress-upgrade/</link>
		<comments>http://rabidgadfly.com/2008/03/how-i-fixed-my-failed-wordpress-upgrade/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 17:59:48 +0000</pubDate>
		<dc:creator>rabidgadfly</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.rabidgadfly.com/?p=63</guid>
		<description><![CDATA[Today I visited my site to find that it was down&#8230;hard. I tried going into the WordPress administrator and was greeted with a message stating that my installation was out of date and that I needed to upgrade. This message was followed by a link to perform the upgrade. After backing up my database I [...]]]></description>
			<content:encoded><![CDATA[<p>Today I visited my site to find that it was down&#8230;hard. I tried going into the WordPress administrator and was greeted with a message stating that my installation was out of date and that I needed to upgrade. This message was followed by a link to perform the upgrade.</p>
<p>After backing up my database I clicked the ominous link and waited. I didn&#8217;t have to wait too long for the upgrade failure message to appear:</p>
<blockquote><p>WordPress database error: [Unknown column 'user_nickname' in 'field list']</p></blockquote>
<p>So I started Googling and found I was far from alone. Great! There must be a solution out there somewhere, I thought. To my surprise, the vast majority of links led to users that had not yet resolved the issue. Luckily I came across a post on remy sharpâ€™s b:log titled <a href="http://remysharp.com/2008/02/06/how-i-fixed-wordpress-broken-upgrade/">How I Fixed WordPress&#8217; Broken Upgrade</a>.</p>
<p>While Remy&#8217;s post did not solve the issue I was having, it definitely got me 50% there. The installation is looking for a column named user_nickname in the wp_users table. So, the first step toward correcting the issue was to add that column using the following sql:</p>
<pre><code>
alter table wp_users add column user_nickname varchar(250);
</code></pre>
<p>Note that, if you&#8217;re using custom table prefixes, you&#8217;ll need to change the table name so that it matches yours.</p>
<p>After adding the column I ran the upgrade again and the error was gone. Unfortunately, so was any other feedback or content on the page. What I ended up with at this point was a WordPress banner at the top of the page and absolutely nothing below it. Again, Remy&#8217;s solution lent a hand.</p>
<p>While Remy&#8217;s post directs you to edit wp-admin/upgrade-functions.php, the code has now been moved to wp-admin/includes/upgrade.php. Turns out that the reason a blank page is appearing is because there is a php error. To fix the error, it was necessary to change a line in upgrade.php (or upgrade-functions.php for older versions) from:</p>
<pre><code>$all_options->{$option->option_name} = stripslashes($option->option_value);</code></pre>
<p>to:</p>
<pre><code>if ($option->option_name) $all_options->{$option->option_name} = stripslashes($option->option_value);</code></pre>
<p>The line in question appears around line 795 (654 in upgrade_function.php).</p>
<p>That&#8217;s basically where Remy&#8217;s issues ended. Unfortunately I wasn&#8217;t so lucky because after running the upgrade again I was still presented with the blank screen. It was at this point that my eyes began turning green. Luckily I was able to calm myself down before my shirt began ripping and my skin turned the same color as my eyes.</p>
<p>I pulled up the upgrade.php file again and began scanning through it. That&#8217;s when I noticed that the table names in the SQL statements were hard-coded. While this is fine for a default installation, it&#8217;s a BIG problem for people who used custom prefixes on their tables.</p>
<p>If you use custom prefixes you&#8217;ll need to change all of the SQL statements to reflect your table names. I&#8217;m sure this is a variable but I didn&#8217;t have the time or inclination to go looking for it. The SQL code can be found from lines 75 through 110.</p>
<p>After fixing the table names I ran the upgrade again with crossed-fingers and&#8230;.. it failed again. Grrrrrrr&#8230;..</p>
<p>This time at least there was an error to research:</p>
<blockquote><p>Allowed memory size of 8388608 bytes exhausted </p></blockquote>
<p>To remedy this issue I had to edit wp-admin/upgrade.php. Note that this upgrade.php file is a different file located one directory up from the upgrade.php that you just finished editing (not confusing at all, right?). I was able to fix the memory issue by adding the following line to the top of the page, just inside the opening PHP tag:</p>
<pre><code>ini_set("memory_limit","12M");</code></pre>
<p>I ran it again and, finally, <em>success</em> &#8230; kind of.</p>
<p>The upgrade completed with the following message:</p>
<blockquote><p>WordPress database error: [Table 'xx_linkcategories' doesn't exist]<br />
SELECT cat_id, cat_name FROM wprg_linkcategories<br />
Upgrade Complete</p>
<p>Your WordPress database has been successfully upgraded!</p></blockquote>
<p>Remy says to ignore the error so I&#8217;m choosing to follow his advice at this point since my site is once again up and running.</p>
<p>I hope this helps some of the stranded WP users out that are having the same issue and can&#8217;t find help. I also hope that the WordPress developers address this issue in an upcoming release. It seems bizarre to me that it&#8217;s existed through multiple versions.</p>
<p>-rG</p>
]]></content:encoded>
			<wfw:commentRss>http://rabidgadfly.com/2008/03/how-i-fixed-my-failed-wordpress-upgrade/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

