<?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>Adam Stacey</title>
	<atom:link href="http://www.adamstacey.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adamstacey.co.uk</link>
	<description>The mind of a technical web guru!</description>
	<lastBuildDate>Wed, 10 Aug 2011 10:22:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Accessing, Getting and Setting Config, Parameters or Settings in Symfony2</title>
		<link>http://www.adamstacey.co.uk/2011/08/10/accessing-getting-and-setting-config-parameters-or-settings-in-symfony2/</link>
		<comments>http://www.adamstacey.co.uk/2011/08/10/accessing-getting-and-setting-config-parameters-or-settings-in-symfony2/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 08:48:12 +0000</pubDate>
		<dc:creator>the guru</dc:creator>
				<category><![CDATA[Symfony2]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[settings]]></category>
		<category><![CDATA[symfony2]]></category>

		<guid isPermaLink="false">http://www.adamstacey.co.uk/?p=221</guid>
		<description><![CDATA[Most web applications will require some specific constants or settings that can be used by any bundle or service. In Symfony2 this is very simple. You can add any parameters [...]]]></description>
			<content:encoded><![CDATA[<p>Most web applications will require some specific constants or settings that can be used by any bundle or service. In Symfony2 this is very simple. You can add any parameters you need to the <strong>/app/config/config.yml</strong> file like this:</p>
<pre name="code" class="brush: shell">
parameters:
    email_address:    "john.smith@anybody.com"
</pre>
<p>To then access that variable in a bundle controller or service we can then use the code:</p>
<pre name="code" class="brush: php">
$email_address = $this->container->getParameter('email_address');
</pre>
<p>If we don&#8217;t want to use the config.yml file and want to set your own parameter through a bundle controller or service you can set a parameter using:</p>
<pre name="code" class="brush: php">
$this->container->setParameter('email_address', 'someone.else@anybody.com');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstacey.co.uk/2011/08/10/accessing-getting-and-setting-config-parameters-or-settings-in-symfony2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using window.location in a JQuery/JavaScript Function on Internet Explorer 6 (IE6)</title>
		<link>http://www.adamstacey.co.uk/2010/08/04/using-window-location-in-a-jqueryjavascript-function-on-internet-explorer-6-ie6/</link>
		<comments>http://www.adamstacey.co.uk/2010/08/04/using-window-location-in-a-jqueryjavascript-function-on-internet-explorer-6-ie6/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 12:49:35 +0000</pubDate>
		<dc:creator>the guru</dc:creator>
				<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://www.adamstacey.co.uk/?p=162</guid>
		<description><![CDATA[Now then, what can I say about my favourite browser that is in my view Microsoft&#8217;s best invention! Crap! Simple as that for now. I will reserve a separate blog [...]]]></description>
			<content:encoded><![CDATA[<p>Now then, what can I say about my favourite browser that is in my view Microsoft&#8217;s best invention! Crap!</p>
<p>Simple as that for now. I will reserve a separate blog for discussing IE6 another time &#8211; or should I say rant. As a web developer I probably spend approximately a third of any development time fixing IE6 bugs. 2014 cannot come soon enough when Microsoft stop supporting the nightmare. Until then&#8230;</p>
<p>Had an interesting issue today: it turns out that if you use window.location in a function you need to make sure you return false otherwise the navigation will not work. No error, just nothing. Puh!</p>
<p>For example, I was doing a very simple click function using JQuery as below:</p>
<pre name="code" class="js">
$("#test_link").click(function()
{
  window.location = 'http://www.google.co.uk/';
});
</pre>
<p>To make it work in IE6 I had to use:</p>
<pre name="code" class="js">
$("#test_link").click(function()
{
  window.location = 'http://www.google.co.uk/';
  return false;
});
</pre>
<p>To be fair to Microsoft they are correct though. We should in fact return something in a function. It is after all good programming, but if is not semantically correct, which is clearly why IE6 does not do anything then why doesn&#8217;t it trigger an error? For me it is lazy coding, which is what the web is all about and it is a shame that we have to spend hours trying to work back to our roots to find out why a perfectly well-coded site does not work in an archaic browser. Rant over <img src='http://www.adamstacey.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstacey.co.uk/2010/08/04/using-window-location-in-a-jqueryjavascript-function-on-internet-explorer-6-ie6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Initiating CKEditor with JQuery and Using JQuery UI Dialog</title>
		<link>http://www.adamstacey.co.uk/2010/07/09/initiating-ckeditor-with-jquery-and-using-jquery-ui-dialog/</link>
		<comments>http://www.adamstacey.co.uk/2010/07/09/initiating-ckeditor-with-jquery-and-using-jquery-ui-dialog/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 09:53:14 +0000</pubDate>
		<dc:creator>the guru</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[ckeditor]]></category>
		<category><![CDATA[ckfinder]]></category>
		<category><![CDATA[dialog]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery ui]]></category>

		<guid isPermaLink="false">http://www.adamstacey.co.uk/?p=149</guid>
		<description><![CDATA[Firstly I have to say how good CKEditor is! You may remember FCKEditor, which CKEditor has evolved from. What a fantastic bit of kit. I would be lost without it. [...]]]></description>
			<content:encoded><![CDATA[<p>Firstly I have to say how good CKEditor is!  You may remember FCKEditor, which CKEditor has evolved from. What a fantastic bit of kit. I would be lost without it. I heavily use JQuery UI with their dialogs and tabs for my web application interfaces. And this is a little gem with a nifty little adapter for JQuery integration. An all for free. I doth my cap to you kind fellows at CKEditor.</p>
<p>I am going to show you how I initiate this within a JQuery UI dialog, so I will assume that you know how to setup and sort a dialog box using JQuery. If not check out the <a target="_blank" href="http://jqueryui.com/demos/dialog/">JQuery UI dialog</a> page. </p>
<p>OK, firstly visit the <a target="_blank" href="http://ckeditor.com/download">CKEditor page</a> and download the latest version of CKEditor and upload it to your site and hook it in with a JavaScript include. The download also includes the necessary JQuery file as an adpator, but not JQuery itself.</p>
<p>Before you do anything you will need to know that for IE6 and IE7 there is a conflict with the z-index of the dialog box and the editor, so you need to add the following JavaScript file to your site after your JQuery and JQuery UI inclusions:</p>
<pre name="code" class="js">
$.extend($.ui.dialog.overlay, { create: function(dialog){
  if (this.instances.length === 0) {
    setTimeout(function() {
      if ($.ui.dialog.overlay.instances.length) {
        $(document).bind($.ui.dialog.overlay.events, function(event) {
          var parentDialog = $(event.target).parents('.ui-dialog');
          if (parentDialog.length > 0) {
            var parentDialogZIndex = parentDialog.css('zIndex') || 0;
            return parentDialogZIndex > $.ui.dialog.overlay.maxZ;
          }
          var aboveOverlay = false;
          $(event.target).parents().each(function() {
            var currentZ = $(this).css('zIndex') || 0;
            if (currentZ > $.ui.dialog.overlay.maxZ) {
              aboveOverlay = true;
              return;
            }
          });
          return aboveOverlay;
        });
      }
    }, 1);
    $(document).bind('keydown.dialog-overlay', function(event) {
      (dialog.options.closeOnEscape &#038;&#038; event.keyCode &#038;&#038; event.keyCode == $.ui.keyCode.ESCAPE &#038;&#038; dialog.close(event));
    });
    $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize);
  }
  var $el = $('
<div></div>

').appendTo(document.body).addClass('ui-widget-overlay').css({
    width: this.width(),
    height: this.height()
  });
  (dialog.options.stackfix &#038;&#038; $.fn.stackfix &#038;&#038; $el.stackfix());
  this.instances.push($el);
  return $el;
}});
</pre>
<p>Now we need to initiate the configuration we are going to use for CKEditor.</p>
<pre name="code" class="js">
<script type="text/javascript">
  var editor_config =
  {
    toolbar:
    [
      ['Source','Maximize'],
      ['Cut','Copy','Paste','PasteText','PasteFromWord','RemoveFormat'],
      ['Undo','Redo'],
      ['Bold','Italic','Underline','Strike','Subscript','Superscript',
        'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
      ['NumberedList','BulletedList','Outdent','Indent'],
      ['Link','Unlink','Image','SpecialChar']
    ],
    height: 260,
    startupFocus: true,
    removePlugins: 'scayt'
  };
</script>
</pre>
<p>Most of it is self-explanatory, but it is worth pointing out a few things while I am here. The remove plugins is a very useful feature to turn off plugins you don&#8217;t want. For example, CKEditor loads a spelling plugin that is good, but it pops up an advert until you buy it. It also messes up any styles you may add into HTML you may use the editor for. To find the name of a plugin to turn off, simply go into the plugins folder and the name of the plugin is the respective folder name. They are all pretty obvious with the exception of the said spelling plugin, which I found out was the scayt plugin.</p>
<p>Another useful config setting I use is:</p>
<pre name="code" class="js">startupMode: 'source'</pre>
<p>The default value is &#8216;wysiwyg&#8217;, but using &#8216;source&#8217; will start the editor in source mode, so you can edit the HTML code directly. I find this useful for developers.</p>
<p>The code for my dialog pop-up box is:</p>
<pre name="code" class="html">

<a id="edit_html_link" href="Javascript:void(0);">Edit HTML</a>
<div id="edit_html" title="Edit HTML">
  <textarea name="html" id="html">HTML code goes here!</textarea>
</div>
</pre>
<p>The JQuery for it is:</p>
<pre name="code" class="js">
// Initialise the dialog box
$("#edit_html").dialog({
  bgiframe: true,
  autoOpen: false,
  width: 990,
  height: 620,
  modal: true,
  draggable: false,
  resizable: false,
  open: function() {
    $(this).find("textarea").ckeditor(editor_config);
  },
  close: function() {
    $(this).find("textarea").ckeditorGet().destroy();
  },
  buttons: {
    'Close': function() {
      $(this).dialog('close');
    }
});
// Opens the dialog box when the edit html link is clicked
$("#edit_html_link").click(function()
{
  $("#edit_html").dialog("open");
});
</pre>
<p>As mentioned above I won&#8217;t talk about the setup of the dialog box and the options used. What I will concentrate on is the open and close functions used in the dialog box. The open function basically tells the site that when the dialog box finishes open look for all textareas within the dialog box and turn them into a CKEditor instance.</p>
<p>The close function simply destroys the instances once the dialog box closes. This is very important as if you don&#8217;t do this you will get a number of JavaScript errors saying something along the lines of &#8220;another instance exists&#8221;.</p>
<p>Another problem I had with the &#8220;another instance exists&#8221; error was that by default if you give your textarea a class of &#8220;ckeditor&#8221; then CKEditor recognises this and creates an instance. You then create another instance and bang pain in the arse error that takes at least half a day to fathom!</p>
<p>And BOOM! You should hopefully have CKEditor installed. You don&#8217;t have to use this for JQuery UI dialogs, but hopefully this will arm you with enough information to set up your CKEditor instances using JQuery.</p>
<p>One final note is that I have also got this working with a combination of JQuery UI dialog boxes and tabs in across all browser including the dreaded Internet Explorer 6!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstacey.co.uk/2010/07/09/initiating-ckeditor-with-jquery-and-using-jquery-ui-dialog/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Creating Your Own File Browser for CKEditor in PHP</title>
		<link>http://www.adamstacey.co.uk/2010/07/09/creating-your-own-file-browser-for-ckeditor-in-php/</link>
		<comments>http://www.adamstacey.co.uk/2010/07/09/creating-your-own-file-browser-for-ckeditor-in-php/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 09:38:18 +0000</pubDate>
		<dc:creator>the guru</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ckeditor]]></category>
		<category><![CDATA[ckfinder]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[file browser]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[wysiwyg]]></category>

		<guid isPermaLink="false">http://www.adamstacey.co.uk/?p=138</guid>
		<description><![CDATA[I am going to talk to anyone out there about how you can create your own file browser for CKEditor. Before you say it CKEditor to provide a file browser [...]]]></description>
			<content:encoded><![CDATA[<p>I am going to talk to anyone out there about how you can create your own file browser for CKEditor. Before you say it CKEditor to provide a file browser and uploader called CKFinder that you can purchase for $59. This article is not about how to develop a file browser to replace this because you don&#8217;t want to pay for CKFinder as frankly CKEditor on it&#8217;s own is worth paying that for. No, this article is about writing your own file browser because you need something different (although there is no reason why you couldn&#8217;t build your own). My only gripe with the boys at CKEditor is although there support guide are detailed they aren&#8217;t quite there yet, but as they are probably spending most of their time developing a great product who am I to complain. Instead I am happy to try and help them out with this post.</p>
<p>Firstly it is useful if you get a feel for how CKEditor recommend you to develop your own file browser and uploader. If you go to their support article on it <a href="http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_%28Uploader%29">here</a> and have a quick read.</p>
<p>I am also only showing you an example for the image upload area, but you can change this for the flash or general browser. It will work the same. I have tested it.</p>
<p>I use the JQuery adapter to initiate CKEditor, so I will start their with my initiation code (for more information on this visit <a href="http://www.adamstacey.co.uk/2010/07/09/initiating-ckeditor-with-jquery-and-using-jquery-ui-dialog/">Initiating CKEditor with JQuery and Using JQuery UI Dialog</a>):</p>
<pre name="code" class="js">
<script type="text/javascript">
  var editor_config =
  {
    toolbar:
    [
      ['Source','Maximize'],
      ['Cut','Copy','Paste','PasteText','PasteFromWord','RemoveFormat'],
      ['Undo','Redo'],
      ['Bold','Italic','Underline','Strike','Subscript','Superscript',
        'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
      ['NumberedList','BulletedList','Outdent','Indent'],
      ['Link','Unlink','Image','SpecialChar']
    ],
    height: 260,
    startupFocus: true,
    removePlugins: 'scayt',
    filebrowserImageBrowseUrl: '/folder/browser-file.php',
    filebrowserWindowWidth: '270',
    filebrowserWindowHeight: '300'
  };
</script>
</pre>
<p>The filebrowserImageBrowseUrl is the URL that you would use. The content displayed for this page is displayed in the pop-up that appears when you click the browse button. Adding this config variable will add the browse button to the image dialog. The other URLs you can also develop are:</p>
<ul>
<li>filebrowserBrowseUrl</li>
<li>filebrowserImageBrowseUrl</li>
<li>filebrowserFlashBrowseUrl</li>
<li>filebrowserUploadUrl</li>
<li>filebrowserImageUploadUrl</li>
<li>filebrowserFlashUploadUrl</li>
</ul>
<p>I am going to keep things simple and give you the basics, so you can take this further and will simply add a couple of links to the pop-up that will load into the image dialog.</p>
<p>My image PHP file looks like this:</p>
<pre name="code" class="php">
<script type="text/javascript">
  function loadFile(url)
  {
    var parent_window = (window.parent == window)
      ? window.opener : window.parent;
    parent_window.CKEDITOR.tools.callFunction(
      <?php echo $_GET['CKEditorFuncNum']; ?>, url, '');
    window.close();
  }
</script>
<a href="Javascript:loadFile('http://www.google.co.uk/intl/en_com/images/srpr/logo1w.png');">
  Google Logo</a>
<a href="Javascript:loadFile('http://s.wordpress.org/style/images/wordpress-logo.png');">
  WordPress Logo</a>
</pre>
<p>So let&#8217;s go through it!</p>
<p>There are two links that when clicked call the loadFile function passing an image URL. The first line of the function is where I cam so stuck with the documentation from CKEditor. In their documentation it says:</p>
<pre name="code" class="js">
window.opener.CKEDITOR.tools.callFunction(
  funcNum, fileUrl [, data] );
</pre>
<p>The issue here is window.opener! Very messy for cross-browser compatibility. I have added a check to the DOM that then selects the right object.</p>
<p>The second line contains the &#8216;CKEditorFuncNum&#8217; variable that is pushed to your dialog box from clicking the browse button in the image dialog box through the query string. This variable basically tells CKEditor what object you are working on and where to send the URL back to. On this line you can see the CKEditor function that passes back the object instance function through CKEditorFuncNum variable as the first parameter. The second parameter is the URL to the image file and the third parameter can be a message. I kept things simple, but you can take this further and provide a message in here if things go wrong. The message is ignored if the URL parameter is not blank, but if the URL parameter is blank the message is displayed in an alert box. This could be useful if you develop your own upload tool. It is this line that sends the URL back to the image dialog box.</p>
<p>The third line simply closes our dialog box.</p>
<p>That should be that in a nutshell. Hopefully it will give you enough to overcome the issues I had to start with. Let me know if you need any further help.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstacey.co.uk/2010/07/09/creating-your-own-file-browser-for-ckeditor-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update Your Screen Capture (Screenshot) Location on Mac OS X</title>
		<link>http://www.adamstacey.co.uk/2010/07/06/update-your-screen-capture-screenshot-location-on-mac-os-x/</link>
		<comments>http://www.adamstacey.co.uk/2010/07/06/update-your-screen-capture-screenshot-location-on-mac-os-x/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 15:56:56 +0000</pubDate>
		<dc:creator>the guru</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[screen capture]]></category>
		<category><![CDATA[screen shot]]></category>

		<guid isPermaLink="false">http://www.adamstacey.co.uk/?p=136</guid>
		<description><![CDATA[Little tip for changing the default path where the Mac screen capture tool drops the screen shots you take. By default any screen shots are dropped on your desktop, which [...]]]></description>
			<content:encoded><![CDATA[<p>Little tip for changing the default path where the Mac screen capture tool drops the screen shots you take. By default any screen shots are dropped on your desktop, which if you are as anal as I am in keeping a clean desktop, does my nut in!</p>
<p>You can also get a number of Mac apps that will do this, but if you like me want to just sort it and be done with it here it is.</p>
<p>Open up terminal.</p>
<p>Firstly you will need to create your new directory that will house your screen shots. A good place could be a folder on your desktop or in your documents with a nice shortcut in your Finder places.</p>
<pre name="code" class="js">mkdir -p /Users/yourname/Documents/Screenshots</pre>
<p>Make sure you change &#8220;yourname&#8221; to your short username (this is normally your name in lowercase and spaces removed). For example, my name is Adam Stacey, so my short username is adamstacey.</p>
<p>Then you need to change the screen capture location:</p>
<pre name="code" class="js">defaults write com.apple.screencapture location /Users/yourname/Documents/Screenshots</pre>
<p>Before it will work you will need to log out and back in again or if you are lazy like me you can restart the service that looks after the screen capture by:</p>
<pre name="code" class="js">killall SystemUIServer</pre>
<p>Now you can test the screen capture by pressing shift+cmd+3 or shift+cmd+4. Your screen shots should now be in your new folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstacey.co.uk/2010/07/06/update-your-screen-capture-screenshot-location-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installing MacPorts</title>
		<link>http://www.adamstacey.co.uk/2010/06/28/installing-macports/</link>
		<comments>http://www.adamstacey.co.uk/2010/06/28/installing-macports/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 21:33:04 +0000</pubDate>
		<dc:creator>the guru</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macports]]></category>

		<guid isPermaLink="false">http://www.adamstacey.co.uk/?p=117</guid>
		<description><![CDATA[MacPorts is a community initiative developed to make it easy for people like me to compile, install and upgrade software through the command-line. Before installing it you will need to [...]]]></description>
			<content:encoded><![CDATA[<p>MacPorts is a community initiative developed to make it easy for people like me to compile, install and upgrade software through the command-line.</p>
<p>Before installing it you will need to meet the following requirements:</p>
<ol>
<li>Apple&#8217;s Xcode Developer Tools (version 3.2.1 or later for Snow Leopard, 3.1.4 or later for Leopard, or 2.5 for Tiger). This software can be found at the <a target="_blank" href="http://developer.apple.com/">Apple Developer Connection</a> or on your Mac OS X installation.</li>
<li>The X11 windowing environment. The “X11 User” package is an optional installation on your system disc for Tiger, enabled through the “Customize” button of the installer, whereas it is included by default on Leopard and Snow Leopard.</li>
</ol>
<h3>Onto the Good Stuff</h3>
<p>Now we have got through the boring stuff we can go on and install MacPorts.</p>
<p>All you need to do is go to the <a target="_blank" href="http://www.macports.org/install.php">MacPorts download page</a> and download the dmg version for your Mac. Shimples!</p>
<p>Once you have installed MacPorts go to your terminal and enter the following to make sure you have the latest and most up-to-date version:</p>
<pre name="code" class="js">sudo port -v selfupdate</pre>
<h3>Problems?</h3>
<p>If you find you are having problems or had problems installing you may need to uninstall MacPorts first. If you need to do so, then you need to uninstall MacPorts through terminal then delete all the prefixed files:</p>
<pre name="code" class="js">
sudo port -f uninstall installed
sudo rm -rf \
    /opt/local \
    /Applications/DarwinPorts \
    /Applications/MacPorts \
    /Library/LaunchDaemons/org.macports.* \
    /Library/Receipts/DarwinPorts*.pkg \
    /Library/Receipts/MacPorts*.pkg \
    /Library/StartupItems/DarwinPortsStartup \
    /Library/Tcl/darwinports1.0 \
    /Library/Tcl/macports1.0 \
    ~/.macports
</pre>
<p>Once you have done this you can follow the installation again. Any problems or suggestions just drop me a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstacey.co.uk/2010/06/28/installing-macports/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Installing Image Magick and Imagick for PHP for MAMP</title>
		<link>http://www.adamstacey.co.uk/2010/06/28/installing-image-magick-and-imagick-for-php-for-mamp/</link>
		<comments>http://www.adamstacey.co.uk/2010/06/28/installing-image-magick-and-imagick-for-php-for-mamp/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 21:15:39 +0000</pubDate>
		<dc:creator>the guru</dc:creator>
				<category><![CDATA[Imagick]]></category>
		<category><![CDATA[MAMP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[image magick]]></category>
		<category><![CDATA[imagick]]></category>
		<category><![CDATA[mamp]]></category>

		<guid isPermaLink="false">http://www.adamstacey.co.uk/?p=111</guid>
		<description><![CDATA[Now this is one topic I am glad I have got through. This caused me no end of grief. I think before we get to the nitty gritty of installing [...]]]></description>
			<content:encoded><![CDATA[<p>Now this is one topic I am glad I have got through. This caused me no end of grief.</p>
<p>I think before we get to the nitty gritty of installing and configuring the software it is important to understand what Image Magick and Imagick are. I thought at first it was the same thing. Oh how wrong!</p>
<p><strong>Image Magick</strong> is a command-line suite of tools to manipulate images. For further information on this visit the <a target="_blank" href="http://www.imagemagick.org/script/index.php">Image Magick</a> site.</p>
<p><strong>Imagick</strong> is an extension of PHP that consists of a number of classes and functions for working with Image Magick. </p>
<p>It basically means we need to install Image Magick first and then compile the Imagick extension in PHP that is dependent on Image Magick.</p>
<h3>1. Installing MacPorts</h3>
<p>To make life easy I installed MacPorts, which made it very easy to install Image Magick. You will need MacPorts in order to follow this post. Don&#8217;t worry if you haven&#8217;t installed MacPorts yet as you can find out how easy it is to install by viewing my <a target="_blank" href="http://www.adamstacey.co.uk/2010/06/28/installing-macports/">&#8220;Installing MacPorts&#8221;</a> post.</p>
<p><strong>Please note that if you have Mac OS X 10.5.x or later you need to have <a target="_blank" href="http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20491">Xcode 3.1.4</a> installed or later.</strong></p>
<p><strong>EDIT:</strong> Big thank you to Mike Puchol and his article <a href="http://mikepuchol.com/2010/08/26/getting-mamp-1-9-to-work-with-image-magick-imagick-so-and-other-flora/">Getting MAMP 1.9 to work with Image Magick, imagick.so and other flora</a> for the next snippet for making MacPorts build universal binaries.</p>
<pre name="code" class="brush: shell">vi /opt/local/etc/macports/variants.conf</pre>
<p>Add the following to the end of the file:</p>
<pre name="code" class="brush: shell">+universal</pre>
<p>Save the file:</p>
<pre name="code" class="brush: shell">?wq</pre>
<h3>2. Installing Image Magick</h3>
<p>Using MacPorts we simply need to enter:</p>
<pre name="code" class="brush: shell">sudo port install ImageMagick</pre>
<p>Now I would suggest putting your feet up, grab something to eat, grab a beer or something else more interesting as this process takes about 30 minutes to finish. There are a number of dependencies that have to be installed.</p>
<h4>Here&#8217;s One I Prepared Earlier&#8230;</h4>
<p>Once that is all sorted you then need to update the environment $PATH variable in your user profile. To access your profile enter:</p>
<pre name="code" class="brush: shell">vi ~/.profile</pre>
<p>Enter the following line:</p>
<pre name="code" class="brush: shell">export PATH="$PATH:/opt/local/bin"</pre>
<p>For more information on this see <a target="_blank" href="http://www.adamstacey.co.uk/2010/06/28/updating-your-export-path-in-os-x/">“Updating Your Export Path in OS X”</a>.</p>
<p>Close terminal and re-open it again. Then test Image Magick to see if it is working:</p>
<pre name="code" class="brush: shell">convert -version</pre>
<p>If you get an error then there is a problem. Drop me a comment and I will see what I can do.</p>
<h3>3. Now Installing The Tricky Imagick!</h3>
<p>We now need to install the Imagick extension using PECL:</p>
<pre name="code" class="brush: shell">sudo pecl install imagick</pre>
<p>Is that it I hear you say? Well let me tell you that it is at this point where I lost my rag given all the problems I had. I had got so lost I even nearly turned to the dark side and tried searching on Bing! To try and help I have added the issues I had and what I did to sort them.</p>
<h4>A Make Error Occurs</h4>
<p>I found this issue is likely to be down to the C compiler not being present. You will notice that there is an error relating to this, but it is right at the beginning of the make output. The easiest way to check if you have the C compiler is to type:</p>
<pre name="code" class="brush: shell">gcc</pre>
<p>If you get a bash error then it is not installed. You can also check to see if the /usr/bin/gcc folder exists as that is where it should be.</p>
<p>So, to fix this issue you simply need to install the Xcode Tools. The quickest way to do this is on the installation disc that came with your Mac. It will be under the optional installs. If you can&#8217;t find the installation disc you can download the latest Xcode tools from the <a target="_blank" href="http://developer.apple.com/">Apple Developer Connection</a> site.</p>
<h4>32bit and 64bit Architecture</h4>
<p>As standard, MacPorts will not build universal binaries, which is what the PHP version run by MAMP uses. And as some versions of Mac OS X like Snow Leopard use 64bit architecture this can cause an issue. To get round this you can force MacPorts to build all the universal binaries by entering:</p>
<pre name="code" class="brush: shell">sudo port upgrade --force installed</pre>
<p>Like installing Image Magick this will take a bit of time, so kick back and relax.</p>
<h4>WARNING: php appears to have a suffix&#8230;</h4>
<p>This is due to the PHP path being referenced twice or more in the environment variable $PATH. This is probably due to the /usr/bin and /Applications/MAMP/bin/php5.3/bin folders being present when they effectively point to the same place. You just need to remove the MAMP path. Restart terminal and you should be good to go. Don&#8217;t forget to check your $PATH enter:</p>
<pre name="code" class="brush: shell">echo $PATH</pre>
<h3>4. Are We There Yet?</h3>
<p>Right, so the install of the Imagick extension has been successful. If so, you should see a message saying where the .so file was installed. You now need to copy that file over to the MAMP files:</p>
<pre name="code" class="brush: shell">cp /usr/lib/php/extensions/no-debug-non-zts-20060613/imagick.so /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/imagick.so</pre>
<p>The above should be similar to yours, but will slightly differ, but you should be able to work it out.</p>
<p>The last bit then. We just need to add the new extension to the php.ini file. In MAMP select File -> Edit Templates and select the php.ini file you are using for your version. In the file add the Imagick extension:</p>
<pre name="code" class="brush: shell">extension=imagick.so</pre>
<p>Apply the changes to MAMP, which should restart Apache and MySQL. Job done!!!</p>
<p>It has been emotional! This was a tough one, so if you need any help or have any suggestions just drop me some comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstacey.co.uk/2010/06/28/installing-image-magick-and-imagick-for-php-for-mamp/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Installing Symfony in MAMP on OS X</title>
		<link>http://www.adamstacey.co.uk/2010/06/28/installing-symfony-in-mamp-on-os-x/</link>
		<comments>http://www.adamstacey.co.uk/2010/06/28/installing-symfony-in-mamp-on-os-x/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 14:50:48 +0000</pubDate>
		<dc:creator>the guru</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[MAMP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mamp]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[pecl]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.adamstacey.co.uk/?p=77</guid>
		<description><![CDATA[At the time of writing I am on a MacBook Pro with OS X 10.5.8, MAMP PRO 1.9 and Symfony 1.4. MAMP? Have you got it and is it installed? [...]]]></description>
			<content:encoded><![CDATA[<p><strong>At the time of writing I am on a MacBook Pro with OS X 10.5.8, MAMP PRO 1.9 and Symfony 1.4.</strong></p>
<p>MAMP? Have you got it and is it installed? If not why not? MAMP is for me the best development environment (Mac, Apache, MySQL, PHP) for the Mac and for £20 you can&#8217;t go wrong. It installs with minimum fuss and gives you a pretty interface to manage your local sites.</p>
<p>If you need MAMP in your life visit the <a target="_blank" href="http://www.mamp.info/en/index.html">MAMP</a> website.</p>
<p>I will now assume you have MAMP installed and we are ready to go. I will also assume that you know of the Symfony PHP framework as you are here reading this. If you need more information on it visit the <a target="_blank" href="http://www.symfony-project.org/">Symfony</a> website. All I will say in this article is rapid web development!</p>
<p>Before you do anything it is very important that we rejig the PHP libraries used by MAMP. MAMP uses its own libraries and not the standard libraries installed as default in Mac OS X. This may seem trivial, but if you want more that just PHP or if you want to add a number of PHP extensions like Imagick for example then this is critical. The issues boil down to the different versions using 32bit and 64bit compilations. I discuss this in more details in <a target="_blank" href="http://www.adamstacey.co.uk/2010/06/28/installing-image-magick-and-imagick-for-php-for-mamp/">&#8220;Installing Image Magick and Imagick for PHP for MAMP&#8221;</a>.</p>
<h3>1. Creating a Host</h3>
<p>Once you have MAMP up and running make sure you have setup a new host for the site.</p>
<div id="attachment_89" class="wp-caption aligncenter" style="width: 410px"><img src="http://www.adamstacey.co.uk/wp-content/uploads/2010/06/Picture-1-e1277741682533.png" alt="MAMP Pro Hosts Page" title="MAMP Pro Hosts Page" width="400" height="356" class="size-full wp-image-89" /><p class="wp-caption-text">MAMP Pro Hosts Page</p></div>
<p>When you visit your new site in your Browser you should be able to see a standard MAMP page.</p>
<h3>2. Moving PHP</h3>
<p>Firstly move the current PHP to a different location (we don&#8217;t need to delete it altogether):</p>
<pre name="code" class="js">sudo mv /usr/bin/php /usr/bin/php-old</pre>
<p>Sudo is a command used to perform operations with the security privileges of the super user and is required for a lot of the main system changes we will be making. You will need to enter your login password when requested by terminal.</p>
<p>Now create a link to MAMPs PHP folder in the /usr/bin/php folder. This uses symlinks (or symbolic links) and tricks the system into thinking the PHP is there without moving MAMPs PHP files. </p>
<pre name="code" class="js">sudo ln -s /Applications/MAMP/bin/php5.3/bin/php /usr/bin/php</pre>
<p><em>Please note that I have installed MAMP and configured it to use PHP 5.3. If you have not chosen to use version 5.3 just replace that in the command with whatever you have used (probably php5).</em></p>
<h3>3. Moving PEAR</h3>
<p>Move the current installation of PEAR to a different location:</p>
<pre name="code" class="js">sudo mv /usr/bin/pear /usr/bin/pear-old</pre>
<p>You may not have PEAR installed in which case skip the above step. You will still need to setup the link below though.</p>
<pre name="code" class="js">sudo ln -s /Applications/MAMP/bin/php5.3/bin/pear /usr/bin/pear</pre>
<p>At this point it will be also worth doing some house cleaning! Update your PEAR channel by entering the following:</p>
<pre name="code" class="js">pear channel-update pear.php.net</pre>
<h3>4. Moving PECL</h3>
<p>Move the current installation of PECL to a different location:</p>
<pre name="code" class="js">sudo mv /usr/bin/pecl /usr/bin/pecl-old</pre>
<p>You may not have PECL installed in which case skip the above step. You will still need to setup the link below though.</p>
<pre name="code" class="js">sudo ln -s /Applications/MAMP/bin/php5.3/bin/pecl /usr/bin/pecl</pre>
<h3>5. Adding the Paths</h3>
<p>Now we need to update the export path, so we can use the PHP, PEAR and PECL commands. For more information on this see <a target="_blank" href="http://www.adamstacey.co.uk/2010/06/28/updating-your-export-path-in-os-x/">&#8220;Updating Your Export Path in OS X&#8221;</a>.</p>
<p>Open your local profile in vi by entering:</p>
<pre name="code" class="js">vi ~/.profile</pre>
<p>Then add the following line into your file:</p>
<pre name="code" class="js">export PATH=/Applications/MAMP/bin/php5.3/bin:$PATH</pre>
<p><em>Don&#8217;t forget to replace the version 5.3 with whatever version you have used.</em></p>
<p>Also remember that these paths won&#8217;t take affect until you close down terminal and re-open it. To test your paths are working type the following:</p>
<pre name="code" class="js">pear list-all</pre>
<p>If you get an error then your paths are not set correctly. Drop me a comment and I will try and help.</p>
<h3>6. Fixing MAMP Permissions</h3>
<p>Unfortunately, there is a small known bug with the permissions used by the PHP, PEAR and PECL files in MAMP. Luckily for you I have done the hair pulling and can steer you through this. To fix the issue simply enter:</p>
<pre name="code" class="js">chmod -R 755 /Applications/MAMP/bin/php5.3/bin/</pre>
<p><em>Again don&#8217;t forget to replace the version 5.3 with whatever version you have used.</em></p>
<h3>7. Installing Symfony</h3>
<p>You could install Symfony using the PEAR library, but I am just not comfortable with this. Any Symfony sites you build in this way then use the core files from the PEAR version of Symfony. If you use PEAR you can become stuck with that version. The reason being is that if you build a website using Symfony 1.0 and then decide for the next project you want to develop in Symfony 1.4 you will have to upgrade the PEAR library from version 1.0 to 1.4 What then happens to the site using the core files for version 1.0? I know that you can freeze the Symfony files, so the PEAR files aren&#8217;t used, but personally I just find this messy. </p>
<h4>The PEAR Way</h4>
<p>As always this is only my opinion on the matter, so if you do want to install the latest version of Symfony using PEAR you can do so by doing the following:</p>
<pre name="code" class="js">
pear channel-discover pear.symfony-project.com
pear install symfony/symfony
</pre>
<p>From here you can follow the installation instructions from <a target="_blank" href="http://www.symfony-project.org/getting-started/1_4/en/">Symfony</a> or you can follow my way below through the whole process.</p>
<h4>&#8230;or I Did It My Way!</h4>
<p>This is also how the developers at Symfony prefer you to do it. In their words: &#8220;It is not the recommended way of installing symfony, as you should prefer a dedicated installation for each of your projects.&#8221;.</p>
<p>My personal preference is to download the Symfony files directly from the Symfony site and go from there. You can download the latest version from the installation page at <a target="_blank" href="http://www.symfony-project.org/installation">http://www.symfony-project.org/installation</a>. I downloaded the file as a tgz file and saved it to the root directory of my local site. Create a new set of folders called lib/vendor:</p>
<pre name="code" class="js">
cd /Applications/MAMP/htdocs/newsite/
mkdir -p lib/vendor
</pre>
<p><em>Remember to replace &#8220;newsite&#8221; with the directory of where your new site is stored locally.</em></p>
<p>You can create your own folder instead of lib/vendor, but this is deemed good practice and from the official Symfony instructions. Next move the tar file into the lib/vendor folder and extract it.</p>
<pre name="code" class="js">
mv symfony-1.4.5.tgz lib/vendor/symfony-1.4.5.tgz
tar -xzvf lib/vendor/symfony-1.4.5.tgz
</pre>
<p>Then we need to rename the extracted folder to something simpler and remove the tar file:</p>
<pre name="code" class="js">
mv lib/vendor/symfony-1.4.5 lib/vendor/symfony
rm lib/vendor/symfony-1.4.5.tgz
</pre>
<h3>8. Creating a Symfony Project</h3>
<p>Now we have installed Symfony we need to setup the project!</p>
<p>Make sure you are in terminal and you are in the directory of your new site. When you are there create a new project:</p>
<pre name="code" class="js">
cd /Applications/MAMP/htdocs/newsite/
php lib/vendor/symfony/data/bin/symfony generate:project PROJECT_NAME
</pre>
<p><em>Remember to replace &#8220;newsite&#8221; with the directory of where your new site is stored locally. Replace PROJECT_NAME with the name of your project. </em></p>
<h3>9. Configuring the Database</h3>
<p>These next instructions are on the basis that you are going to use Doctrine instead of Propel. Doctrine and Propel are two database extraction layers that allow you to easily access and manipulate your database. Propel was used in the earlier versions of Symfony, but the developers of Symfony are now pushing Doctrine and I tend to agree with them. If you want to use Propel you can find out more how to setup Symfony with Propel by visiting the <a target="_blank" href="http://www.symfony-project.org/getting-started/1_4/en/04-Project-Setup">Symfony Installation Guide</a> page.</p>
<pre name="code" class="js">./symfony configure:database "mysql:host=localhost;dbname=dbname" root password</pre>
<p>There are many ways you can setup your database to work with Symfony. For more information on this see <a target="_blank" href="http://www.adamstacey.co.uk/">&#8220;Creating and Updating Your Database in Symfony&#8221;</a> article.</p>
<h3>10. Creating Your Application</h3>
<p>Then you need to setup your first application:</p>
<pre name="code" class="js">./symfony generate:app frontend</pre>
<p>You would think this would do now, but there is two more things you need to do.</p>
<ol>
<li>Go back to MAMP and update the Disk location of the local site to now point to the &#8220;web&#8221; folder. It would have been something like &#8220;/Applications/MAMP/htdocs/newsite&#8221;. It now needs to be &#8220;/Applications/MAMP/htdocs/agentdunas/web&#8221; as the web folder in Symfony is the document root folder.</li>
<li>Apply the changes to MAMP PRO, which should result in Apache and MySQL being restarted.</li>
</ol>
<p>Now if you go to the site you should see a nice formatted Symfony welcome page. Unfortunately, you won&#8217;t as Symfony&#8217;s default files are not yet tied up to our web folder! Fear not though a simple symlink should do the trick.</p>
<div id="attachment_95" class="wp-caption aligncenter" style="width: 410px"><img src="http://www.adamstacey.co.uk/wp-content/uploads/2010/06/Picture-2-e1277745438659.png" alt="Not So Pretty Symfony Welcome Page" title="Not So Pretty Symfony Welcome Page" width="400" height="145" class="size-full wp-image-95" /><p class="wp-caption-text">Not So Pretty Symfony Welcome Page</p></div>
<p>Try this:</p>
<pre name="code" class="js">ln -s /Applications/MAMP/htdocs/newsite/lib/vendor/symfony/data/web/sf/ web/sf</pre>
<p>You should now see:</p>
<div id="attachment_97" class="wp-caption aligncenter" style="width: 310px"><img src="http://www.adamstacey.co.uk/wp-content/uploads/2010/06/Picture-3-e1277746014390.png" alt="The Correct Symfony Welcome Page" title="The Correct Symfony Welcome Page" width="300" height="224" class="size-full wp-image-97" /><p class="wp-caption-text">The Correct Symfony Welcome Page</p></div>
<p>That was a long one! As always drop me any questions or suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstacey.co.uk/2010/06/28/installing-symfony-in-mamp-on-os-x/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Updating Your Export Path in OS X</title>
		<link>http://www.adamstacey.co.uk/2010/06/28/updating-your-export-path-in-os-x/</link>
		<comments>http://www.adamstacey.co.uk/2010/06/28/updating-your-export-path-in-os-x/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 14:14:06 +0000</pubDate>
		<dc:creator>the guru</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[bash profile]]></category>
		<category><![CDATA[export path]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://www.adamstacey.co.uk/?p=69</guid>
		<description><![CDATA[Seems like a simple one doesn&#8217;t it! I thought, so until I tried Googling it. I thought I would post a brief article about how to do this and explain [...]]]></description>
			<content:encoded><![CDATA[<p>Seems like a simple one doesn&#8217;t it! I thought, so until I tried Googling it. I thought I would post a brief article about how to do this and explain how to use the Mac profile.</p>
<p>Firstly lets explain what the export path is. In simple terms the path is an environment variable called $PATH. The PATH environment variable is a colon-delimited list of directories that your shell searches through when you enter a command.</p>
<p>To see what your current $PATH variable is, enter the following in your terminal:</p>
<pre name="code" class="js">echo $PATH</pre>
<p>So, how do we add to this. Well the variable is updated through the profiles stored on your Mac. The default profile is stored in the /etc folder and is loaded for all users. To edit this enter the following in terminal:</p>
<pre name="code" class="js">vi /etc/profile</pre>
<p>In some cases you may want to add to the path just for a user. In this case you need to use the users profile by entering (you need to be logged in as them):</p>
<pre name="code" class="js">vi ~/.profile</pre>
<p><strong>If you do not have a profile setup, the vi command will add one to your system by opening a new file. For more information and a basic guide on how to use vi visit my <a href="http://www.adamstacey.co.uk/">&#8220;How to Use vi and Learn Some Basic vi Commands&#8221;</a>.</strong></p>
<p><strong>If you don&#8217;t like using vi or have no idea you can use your default text editor and open the file by entering the following in terminal:</strong></p>
<pre name="code" class="js">open .profile</pre>
<p>So, how do we add to the export path then? Well if you want to replace the path with your own directories you simply enter:</p>
<pre name="code" class="js">export PATH=/directory_1:/directory_2</pre>
<p><em>Note how each directory location is separated by a &#8220;:&#8221;.</em></p>
<p>For example:</p>
<pre name="code" class="js">export PATH=/opt/local/bin:/opt/local/sbin</pre>
<p>It is important to note that a local user profile for a user will override the default path variable if you set it to your own paths. This is not always good. Especially if you have other apps using the path variable. In this case you don&#8217;t want to overwrite them when your machine loads. To get around this we just append to the path. To do this we enter:</p>
<pre name="code" class="js">export PATH=/directory_1:/directory_2:$PATH</pre>
<p>or</p>
<pre name="code" class="js">export PATH=$PATH:/directory_1:/directory_2</pre>
<p>Don&#8217;t forget the paths run in order of priority, so the paths that come first are used first. This is why you can append before or after the current path as showed above. A real-life example may look like:</p>
<pre name="code" class="js">export PATH=/opt/local/bin:/opt/local/sbin:$PATH</pre>
<p>Well I hope that clears up some confusion. It may just have been me, but there we go. Comment me with any questions or suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstacey.co.uk/2010/06/28/updating-your-export-path-in-os-x/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Fixing &#8220;No Network Card Installed&#8221; on a Mac</title>
		<link>http://www.adamstacey.co.uk/2010/06/26/fixing-no-network-card-installed-on-a-mac/</link>
		<comments>http://www.adamstacey.co.uk/2010/06/26/fixing-no-network-card-installed-on-a-mac/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 09:03:46 +0000</pubDate>
		<dc:creator>the guru</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[airport card]]></category>
		<category><![CDATA[internet connection]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macbook pro]]></category>
		<category><![CDATA[network]]></category>

		<guid isPermaLink="false">http://www.adamstacey.co.uk/?p=59</guid>
		<description><![CDATA[This was a particular pain in the arse for me and caused me no end of grief! Hopefully this post will help some of you in a similar situation. At [...]]]></description>
			<content:encoded><![CDATA[<p>This was a particular pain in the arse for me and caused me no end of grief! Hopefully this post will help some of you in a similar situation.</p>
<p><strong>At the time of writing this fix works on a MacBook Pro 15 inch running Mac OS X 10.5.2.</strong></p>
<p>Looking at some other posts around there were a number of potential causes and fixes. I tried them all and found one that worked. I have compiled a list of these different methods though, so hopefully one will work for you. It does my head in when people post what worked for them, but not everything else they tried. I hope to write posts that cover all angles!</p>
<p>Before you try any methods there is a simple test that will determine the severity of the problem you may have, which is worth doing before you attempt to try and fix the issue.</p>
<h3>Diagnostic Check</h3>
<ol>
<li>Make sure you have your Mac OS X install disc in your optical drive.</li>
<li>Shut down your machine.</li>
<li>Turn on your machine again and hold down the Shift key. This will boot your machine in safe mode.</li>
<li>Shut down your machine again.</li>
<li>Remove the battery.</li>
<li>Remove the power cord.</li>
<li>Hold down the power button for 5 seconds.<br /><em>This has reset your System Management Controller (SMC).</em></li>
<li>Turn your machine on and hold down the &#8220;c&#8221; key while the computer boots.</li>
<li>Check for an Airport menu while booted to the install disc.</li>
</ol>
<p>If there was no sight of anything Airport related you are basically dealing with a shot Airport card or motherboard. If there is a mention then we are good to try one of the methods below to resolve the issue.</p>
<h3>Method 1: Reinstall Mac OS X</h3>
<p>Straight forward to do, but a pain in the arse setting up your machine all over again. I did this and it worked until I downloaded the latest updates for Mac OS X from Apple. I had heard that the Airport card issue seemed to appear after a particular update is installed from Apple. This appeared to be the case for me, so I would not recommend reinstalling Mac OS X in this case. If you are starting from scratch then it is all good.</p>
<h3>Method 2: Remove the Airport Extension</h3>
<p>Go to the /system/library/extensions/ folder and find the appleairport.kext file. Delete this file and shut down your machine. Don&#8217;t restart your machine. Apparently you need to shut down your machine. You will also get a message about cache, which is fine and expected. This method didn&#8217;t work for me, but it did seem to for a lot of people out there.</p>
<h3>Method 3: &#8220;That&#8217;s the Badger!&#8221;</h3>
<p>This was the jackpot for me! Following the below steps sorted the issue and I haven&#8217;t looked back since.</p>
<ol>
<li>Shut down your machine.</li>
<li>Turn on your machine again and hold down the Shift key. This will boot your machine in safe mode.</li>
<li>Shut down your machine again.</li>
<li>Remove the battery.</li>
<li>Remove the power cord.</li>
<li>Hold down the power button for 5 seconds.<br /><em>This has reset your System Management Controller (SMC).</em></li>
<li>Turn your machine on and hold down the &#8220;cmd&#8221; (command), &#8220;alt&#8221; (option), &#8220;p&#8221; and &#8220;r&#8221; keys.</li>
<li>Keep holding down the keys as above until you get a blue screen and a start-up chime three times.<br /><em>This will take a bit of time, but keep holding the keys down until you hear the last start-up chime.</em></li>
</ol>
<p>Again these methods may not work for everybody, but hopefully it will work for some of you. Give me a shout if you have any questions or suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstacey.co.uk/2010/06/26/fixing-no-network-card-installed-on-a-mac/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

