<?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>The Code Train &#187; commandline</title>
	<atom:link href="http://thecodetrain.co.uk/tag/commandline/feed/" rel="self" type="application/rss+xml" />
	<link>http://thecodetrain.co.uk</link>
	<description>Where Neil Crosby talks about coding on the train...</description>
	<lastBuildDate>Sun, 03 Apr 2011 18:15:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using WordPress&#8217;s &#8220;Upgrade Automatically&#8221; Feature</title>
		<link>http://thecodetrain.co.uk/2009/12/using-wordpresss-upgrade-automatically-feature/</link>
		<comments>http://thecodetrain.co.uk/2009/12/using-wordpresss-upgrade-automatically-feature/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 22:41:12 +0000</pubDate>
		<dc:creator>Neil Crosby</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://thecodetrain.co.uk/?p=339</guid>
		<description><![CDATA[<p>Yup, it&#8217;s time for the WordPress upgrade dance, yet again &#8211; <a href="http://wordpress.org/development/2009/12/wordpress-2-9/">2.9 Carmen</a> has just been released and everyone using WordPress is being &#8220;urged&#8221; to upgrade.</p>

<p>Now, I&#8217;m slightly ashamed to admit it, but up until last week I hadn&#8217;t been upgrading regularly. It had seemed like in order to be able to use WordPress&#8217;s &#8220;Upgrade Automatically&#8221; functionality I had to either enable FTP (ewwww), or FTPS (seemed like a lot of effort, and needed the SSH extension for PHP installing). So, I&#8217;d ended up doing an upgrade every now and then manually. Not the best plan in the world.</p>

<p>So, last week I decided to take another look and see if there wasn&#8217;t a more sensible way to enable WordPress to run its &#8220;Upgrade Automatically&#8221; code.  Turns out there is &#8211; just make sure the directory you&#8217;re running WordPress under is owned by the same user that your web server is running as. Do this, and suddenly &#8220;Upgrade Automatically&#8221; works, and you&#8217;re a happy camper.</p>

<p>And how to do that? Simple.  First, find out which user your web server is running as:</p>

<pre><code>ps aux | grep apache
</code></pre>

<p>Generally, the answer will be <code>www-data</code>. Then, once you&#8217;ve worked out who the server&#8217;s owner is, change the owner of your WordPress directory tree:</p>

<pre><code>chown -R www-data:www-data /path/to/wordpress/
</code></pre>

<p>Then, when you go back into WordPress you&#8217;ll be able to click on the &#8220;Upgrade Automatically&#8221;, and WordPress will actually upgrade itself.  Hooray! (Of course, don&#8217;t forget to back up before you do this. I am not responsible for your data, follow instructions at your own risk, Santa Claus is real, etc.)</p>

<p>Hopefully this is of use to someone out there. It&#8217;s certainly made me happier about the whole upgrade dance.</p>

<h2>Update</h2>

<p>As Chris so rightly points out below, leaving things open to the web server to change willy nilly can be a little silly, so after running the update do another <code>chown</code>, this time changing the ownership back to your username and group.</p>
<div style="display:block"><small><em><a href="http://neilcrosby.com">Neil Crosby</a> also blogs at about t-shirts at <a href="http://iwearcotton.com">I Wear Cotton</a>, writes <a href="http://thetenwordreview.com/users/workingwithme">Ten Word Reviews</a>, and uploads <a href="http://www.flickr.com/photos/thevoicewithin/">photos</a> to flickr.  You can follow a combined feed of posts at <a href="http://neilcrosby.com/">NeilCrosby.com</a>.</em></small></div>]]></description>
			<content:encoded><![CDATA[<p>Yup, it&#8217;s time for the WordPress upgrade dance, yet again &#8211; <a href="http://wordpress.org/development/2009/12/wordpress-2-9/">2.9 Carmen</a> has just been released and everyone using WordPress is being &#8220;urged&#8221; to upgrade.</p>

<p>Now, I&#8217;m slightly ashamed to admit it, but up until last week I hadn&#8217;t been upgrading regularly. It had seemed like in order to be able to use WordPress&#8217;s &#8220;Upgrade Automatically&#8221; functionality I had to either enable FTP (ewwww), or FTPS (seemed like a lot of effort, and needed the SSH extension for PHP installing). So, I&#8217;d ended up doing an upgrade every now and then manually. Not the best plan in the world.</p>

<p>So, last week I decided to take another look and see if there wasn&#8217;t a more sensible way to enable WordPress to run its &#8220;Upgrade Automatically&#8221; code.  Turns out there is &#8211; just make sure the directory you&#8217;re running WordPress under is owned by the same user that your web server is running as. Do this, and suddenly &#8220;Upgrade Automatically&#8221; works, and you&#8217;re a happy camper.</p>

<p>And how to do that? Simple.  First, find out which user your web server is running as:</p>

<pre><code>ps aux | grep apache
</code></pre>

<p>Generally, the answer will be <code>www-data</code>. Then, once you&#8217;ve worked out who the server&#8217;s owner is, change the owner of your WordPress directory tree:</p>

<pre><code>chown -R www-data:www-data /path/to/wordpress/
</code></pre>

<p>Then, when you go back into WordPress you&#8217;ll be able to click on the &#8220;Upgrade Automatically&#8221;, and WordPress will actually upgrade itself.  Hooray! (Of course, don&#8217;t forget to back up before you do this. I am not responsible for your data, follow instructions at your own risk, Santa Claus is real, etc.)</p>

<p>Hopefully this is of use to someone out there. It&#8217;s certainly made me happier about the whole upgrade dance.</p>

<h2>Update</h2>

<p>As Chris so rightly points out below, leaving things open to the web server to change willy nilly can be a little silly, so after running the update do another <code>chown</code>, this time changing the ownership back to your username and group.</p>
]]></content:encoded>
			<wfw:commentRss>http://thecodetrain.co.uk/2009/12/using-wordpresss-upgrade-automatically-feature/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

