<?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>BinaryKitten&#039;s Blog &#187; files</title>
	<atom:link href="http://binarykitten.me.uk/tag/files/feed" rel="self" type="application/rss+xml" />
	<link>http://binarykitten.me.uk</link>
	<description></description>
	<lastBuildDate>Thu, 09 Sep 2010 10:33:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>PHP &#8211; Chmod-ed to Windows hell and back</title>
		<link>http://binarykitten.me.uk/dev/php/159-php-chmod-ed-to-windows-hell-and-back.html</link>
		<comments>http://binarykitten.me.uk/dev/php/159-php-chmod-ed-to-windows-hell-and-back.html#comments</comments>
		<pubDate>Tue, 10 Mar 2009 21:05:22 +0000</pubDate>
		<dc:creator>BinaryKitten</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[chmod]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[files]]></category>

		<guid isPermaLink="false">http://binarykitten.jkrswebsolutions.co.uk/?p=159</guid>
		<description><![CDATA[Today has not been a good day. With various things going wrong, I was please that I had got the file upload code done for a site i&#8217;m working on. All I needed to do was make sure that the file had the right permissions and then edit it via GD (via an image editor [...]]]></description>
			<content:encoded><![CDATA[<p>Today has not been a good day.</p>
<p>With various things going wrong, I  was please that I had got the file upload code done for a site i&#8217;m working on. All I needed to do was make sure that the file had the right permissions and then edit it via GD (via an image editor class i have). Here&#8217;s where the trouble started..</p>
<p>I started off by chmoding the file to 777 and then trying to do the resize.. this threw an error with permissions.. so i looked at the file.. Read Only.. strange I thought.</p>
<p>Then I checked the folder and that had a weird green square instead of the checkmark in the checkbox. I tried to remove the read only attribute off of this and hte file.. and it kept coming back.. I went all around hte houses, trying all sorts of techniques .. to no avail.</p>
<p><a href="http://twitter.com/auroraeosrose">@auroraeosrose</a> in the PHPWomen IRC channel helped a lot as did Dreis.. (thanks muchly)..</p>
<p>After backing up the files and formatting the drive, to reinstalling the Apache/PHP/MySql stack I was no clearer to the answer as to why the file was always ending up with read only permissions..</p>
<p>Finally it came down to the 1 thing that I had overlooked.. the <a href="http://php.net/chmod">chmod</a> in the code .. the second parameter was 777. I thought this was correct. Aparrantly not. The second parameter of the chmod function requires an octal code.. thus prefixing the 777 with a 0 (zero) fixed the whole issue.</p>
<p>Boy did i really feel dumb today.</p>
<p>So to wrap up, remember to always pass a FOUR digit code through to chmod or face the annoyance and headache I got today.</p>
]]></content:encoded>
			<wfw:commentRss>http://binarykitten.me.uk/dev/php/159-php-chmod-ed-to-windows-hell-and-back.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
