<?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>Leonard Teo &#187; Web Development</title>
	<atom:link href="http://www.leonardteo.com/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.leonardteo.com</link>
	<description></description>
	<lastBuildDate>Thu, 26 Aug 2010 17:51:57 +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>Getting PHP XDebug, CodeIgniter and Netbeans to all work nicely together</title>
		<link>http://www.leonardteo.com/2010/08/getting-php-xdebug-codeigniter-and-netbeans-to-all-work-nicely-together/</link>
		<comments>http://www.leonardteo.com/2010/08/getting-php-xdebug-codeigniter-and-netbeans-to-all-work-nicely-together/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 13:58:26 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[Tip]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.leonardteo.com/?p=322</guid>
		<description><![CDATA[After coding with CodeIgniter for the last 8 months, I&#8217;ve reached a point where a serious debugger is actually going to come in handy (it&#8217;s hard to believe I lasted [...]]]></description>
			<content:encoded><![CDATA[<p>After coding with <a href="http://www.codeigniter.com">CodeIgniter</a> for the last 8 months, I&#8217;ve reached a point where a serious debugger is actually going to come in handy (it&#8217;s hard to believe I lasted that long using print_r and echo statements!). A real debugger gives you stack traces, function traces, parameter/variable display, break points, watch variables and all that goodness. The problem is that I&#8217;ve never been able to get a debugger actually operational <em>and </em>usable with my dev environment and CodeIgniter&#8217;s URL rewrites&#8230; until this morning.</p>
<p>My dev setup is like this: I use <a href="http://www.netbeans.org">Netbeans</a> IDE on my Windows Workstation. I always push and test on a cloud server at <a href="http://www.rackspacecloud.com">Rackspace Cloud</a> running Ubuntu, so that my clients can see and test whatever I&#8217;m doing for them. I use CodeIgniter and PHP. I usually use Chrome as my browser. In this case, we&#8217;re going to install and run <a href="http://www.xdebug.org/">XDebug</a>.</p>
<h2>Getting and Installing XDebug</h2>
<p>Thankfully, Ubuntu has an amazing utility called &#8216;apt-get&#8217;, which lets you simply type in &#8216;apt-get install php5-xdebug&#8217; to install the xdebug package. If you&#8217;re using a different OS, you&#8217;ll need to figure out how to install XDebug. On Mac OS X, you can just use MAMP and uncomment the XDebug line in the php.ini file, and follow the instructions below to add remote debugging.</p>
<p>Back to my Ubuntu setup. The Ubuntu &#8220;apt-get&#8221; installer will put the xdebug config file in: /etc/php5/apache2/conf.d/xdebug.ini</p>
<p>If you&#8217;re compiling xdebug or using some other way of installing it, you just need to find out where the install is calling the xdebug PHP extension. It&#8217;s usually in php.ini.</p>
<p>Open the config file and add the following after this line:</p>
<pre>zend_extension=/usr/lib/php5/20090626/xdebug.so    //This should already be in...</pre>
<pre>/** Add these lines **/
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host= {YOUR HOSTNAME OR IP ADDRESS ** SEE NOTE BELOW}
xdebug.remote_port=9000</pre>
<p>If you are running your test server on your local workstation using MAMP/XAMPP or whatever, just put in &#8216;localhost&#8217; into the remote_host. If you&#8217;re like me and running it on the internet on network, you need to get the IP address of your computer.</p>
<p>Test that it&#8217;s working: restart apache, make a script called phpinfo.php and add in:</p>
<pre>&lt;?php
phpinfo();
?&gt;</pre>
<p>Run that in your browser. You should see a whole section on XDebug, with the settings you included above, that verifies that XDebug is working.</p>
<p><strong>Tricky/optional bit for people wanting to run this remotely&#8230;</strong></p>
<p>If you&#8217;re running on a network with a router and subnet, you&#8217;ll need to find your public internet address and be able to forward packets on port 9000 to your workstation.</p>
<p>What I did, was logged into my Netgear router to get my public internet address. Because my workstation is on a subnet, you need to do port forwarding of packets coming in on port 9000.There should be a &#8220;Port Forwarding&#8221; section where you can add port 9000 and have all communication forwarded to an IP address (the address of your workstation).</p>
<p>Because I&#8217;m running a debugging session remotely, there is a likelihood that my ISP will give me a different IP address later. That simply means that I have to change the xdebug.ini (or php.ini) setting again to point to my new IP address.</p>
<h2>Netbeans</h2>
<p>In your project properties (right click on the project -&gt; properties), click on Run Configuration, look for the &#8220;Advanced&#8230;&#8221; button and set &#8220;<strong>Do Not Open Web Browser</strong>&#8220;. Click OK.</p>
<h2>Chrome or Firefox</h2>
<p>You need the &#8220;Xdebug helper&#8221; extension/add-on. Install that from within your browser.</p>
<p>If you&#8217;re using the <a href="https://chrome.google.com/extensions/detail/eadndfjplgieldjbigjakmdgkmoaaaoc">Xdebug helper in Chrome</a>, you may need to go into its options and add the domain that you want to debug, so that it will show you the debugger and profiler button. <a href="https://chrome.google.com/extensions/detail/eadndfjplgieldjbigjakmdgkmoaaaoc">See this</a>.</p>
<h2>Debugging</h2>
<p>In Netbeans, open a file like a Codeigniter controller or something. Add a breakpoint somewhere interesting. Press CTRL+F5 to start debugging. Switch to Chrome, go to the URL of the controller that you&#8217;re debugging. It should automatically switch back to Netbeans with index.php open and the program paused at the first line of code to say &#8220;I&#8217;m ready to debug!&#8221; Click on Continue (or press F5) and it should bring you to your breakpoint, where you can observe all your variables, call stack, etc.</p>
<p>And developing in CodeIgniter suddenly became even more awesome&#8230;.</p>
<p><strong>Notes and Erratta</strong></p>
<p><a href="http://www.expressionengine.com">Expression Engine</a> and XDebug don&#8217;t like each other! Turns out that there is a piece of code in EE that <a href="http://expressionengine.com/archived_forums/viewthread/157933/">causes a segmentation fault</a>. Apparently newer builds of XDebug have resolved this bug but on my latest apt-get of XDebug, I&#8217;m still having issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leonardteo.com/2010/08/getting-php-xdebug-codeigniter-and-netbeans-to-all-work-nicely-together/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to set up a local web server on your computer with Apache, PHP and MySQL</title>
		<link>http://www.leonardteo.com/2010/07/how-to-set-up-a-local-web-server-on-your-computer-with-apache-php-and-mysql/</link>
		<comments>http://www.leonardteo.com/2010/07/how-to-set-up-a-local-web-server-on-your-computer-with-apache-php-and-mysql/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 22:07:52 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.leonardteo.com/?p=210</guid>
		<description><![CDATA[In this tutorial, I&#8217;m going to explain how to set up a web server on your computer (Windows) with Apache, PHP and MySQL. I&#8217;m also going to show you how [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial, I&#8217;m going to explain how to set up a web server on  your computer (Windows) with Apache, PHP and MySQL. I&#8217;m also going to  show you how to configure name-based virtual hosting so that you can run  multiple sites off the web server. I&#8217;m then going to validate the set  up by installing WordPress.</p>
<p><strong>Why would you want to do this?</strong></p>
<p>The main reason for setting up a local web server is so that you can  develop and test your website(s) very quickly, without having to  constantly upload to another server. It&#8217;s a good way to &#8220;stage&#8221; your  content in an environment which somewhat mimics what the live server  environment would be. Whether you&#8217;re developing themes or plug-ins for  wordpress, or creating a site from scratch using PHP/MySQL, this is a  great way to develop and test stuff.</p>
<p><strong>Explanation</strong></p>
<p>This is basically a three step process (and it would be the same on a  Mac, though I&#8217;m doing this on a PC):</p>
<ol>
<li>Install <a href="http://www.apachefriends.org/">XAMPP</a> (or MAMPP)</li>
<li>Configure Apache virtual hosts file</li>
<li>Configure host file</li>
</ol>
<p><strong>Install XAMPP</strong></p>
<p>Installing XAMPP is dead easy. <a href="http://www.apachefriends.org/">Download it</a> and install it.</p>
<p>The one thing that I would recommend to do before jumping into configuring virtual hosting is that you fire up XAMPP to make sure that the installation works. You can start XAMPP either by using the GUI which is conveniently installed to your Start Menu. Look for &#8220;XAMPP Control Panel&#8221;. Or you can start using the command line by clicking Start-&gt;Run and typing &#8220;cmd&#8221;. Type &#8220;cd c:\xampp&#8221;. Then &#8220;xampp_start&#8221;.</p>
<p>Make sure you have other network-listening apps such as Skype turned off as they may prevent Apache from starting.</p>
<p>You should now be able to fire up a web browser and visit http://localhost, which will load up the default XAMPP page.</p>
<p><strong>Configuring Virtual Hosting<br />
</strong></p>
<p>Virtual hosting is basically a way of hosting multiple websites  through the same server. It&#8217;s as if it&#8217;s running several servers but  it&#8217;s all running off one server and IP address. So&#8230;for example&#8230; if  you have a server and it has the IP address of 127.0.0.1, you can run  10, 20, 100 different websites on that server. You&#8217;d also be able to  call the individual websites by their name. For example in this case I  have &#8220;upvector.local&#8221;.</p>
<p>Once you&#8217;ve validated that the installation of XAMPP works, you&#8217;ll  need to set up the Apache virtual hosts file. This is typically in:</p>
<pre>XAMPP installation directory\apache\conf\extra\httpd-vhosts.conf</pre>
<p>Look for this line:</p>
<pre>#NameVirtualHost *:80</pre>
<p>Un-comment it so that it reads without the pound sign before it:</p>
<pre>NameVirtualHost *:80</pre>
<p>Each &#8220;virtual host&#8221; has its own set up. You&#8217;ll need one for the  default &#8220;localhost&#8221; name, so that when you type &#8220;localhost&#8221;, you get all  the XAMPP utilities.</p>
<pre>&lt;VirtualHost *:80&gt;
    DocumentRoot "C:\xampp\htdocs"
    ServerName localhost
    &lt;Directory "C:\xampp\htdocs"&gt;
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    &lt;/Directory&gt;
&lt;/VirtualHost&gt;
</pre>
<p>To create any arbitrary virtual host, you basically create a new  definition using &lt;VirtualHost *:80&gt;. E.g. to create one for  &#8220;upvector.local&#8221;, you&#8217;d use this code:</p>
<pre name="code">&lt;VirtualHost *:80&gt;
    DocumentRoot "C:\webprojects\upvector"
    ServerName upvector.local
    &lt;Directory "C:\webprojects\upvector"&gt;
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    &lt;/Directory&gt;
&lt;/VirtualHost&gt;
</pre>
<p><strong>Configuring the Hosts file</strong></p>
<p>Once you&#8217;ve configured Apache, you&#8217;ll need to configure your  operating system&#8217;s &#8220;hosts&#8221; file. This will let your OS know that when  you call a particular network host name, it will route it back to your  computer.</p>
<p>To find your hosts file, go to this <a href="http://en.wikipedia.org/wiki/Hosts_file">page</a> on Wikipedia  where they have documented the hosts file on almost every operating  system.</p>
<p>On Windows, it is typically here:</p>
<pre><code>C:\Windows\system32\drivers\etc\hosts</code></pre>
<p>I recommend that you use <a href="http://notepad-plus-plus.org/">Notepad ++</a> to edit text files. Make sure  that when you run Notepad++ (or whatever text editing app), that you  RIGHT-CLICK and RUN AS ADMINISTRATOR. If you don&#8217;t run the program as an  administrator, you&#8217;ll be unable to write to the hosts file.</p>
<p>For each of the virtual hosts that you want to run, add:</p>
<pre>127.0.0.1        host_name</pre>
<p>E.g.</p>
<pre>127.0.0.1        upvector.local
</pre>
<p>Restart Apache. If you did everything correctly, it should start back  up and you&#8217;ll be able to type the host name into your browser and it&#8217;ll  serve the correct website.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leonardteo.com/2010/07/how-to-set-up-a-local-web-server-on-your-computer-with-apache-php-and-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CG Channel goes video-based</title>
		<link>http://www.leonardteo.com/2010/02/cg-channel-goes-video-based/</link>
		<comments>http://www.leonardteo.com/2010/02/cg-channel-goes-video-based/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 17:54:01 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.leonardteo.com/?p=180</guid>
		<description><![CDATA[One of the cool things about working on CG Channel again but under the auspices of Gnomon is that we can innovate and do it really quickly. This week, we [...]]]></description>
			<content:encoded><![CDATA[<p>One of the cool things about working on CG Channel again but under the auspices of Gnomon is that we can innovate and do it really quickly. This week, we announced the new content direction for CG Channel, going video-based. Watch the announcement <a href="http://www.cgchannel.com/2010/02/new-cg-channel-content-direction/">here</a>.</p>
<p>We&#8217;ve already posted a few really good interviews on the site:</p>
<ul>
<li><a href="http://www.cgchannel.com/2010/02/digital-domain-on-transformers-2-dan-taylor/">Digital Domain on Transformers 2</a></li>
<li><a href="http://www.cgchannel.com/2010/02/interview-with-concept-artist-paul-richards/">Interview with Darksiders artist Paul Richards</a></li>
<li><a href="http://www.cgchannel.com/2010/02/andy-park-on-god-of-war-3/">Andy Park on God of War 3</a></li>
<li><a href="http://www.cgchannel.com/2010/01/interview-with-terryl-whitlatch/">Interview with Terryl Whitlach</a></li>
<li><a href="http://www.cgchannel.com/2009/11/2012-behind-the-scenes-with-digital-domain-2/">2012: Behind the Scenes with Digital Domain</a></li>
<li><a href="http://www.cgchannel.com/2009/11/the-making-of-2012-interview-with-volker-engel-marc-weigert/">The Making of 2012: Interview with Volker Engel &amp; Marc Weigert</a></li>
<li><a href="http://www.cgchannel.com/2009/10/behind-the-scenes-with-digital-domain-for-gi-joe-rise-of-cobra-2/">GI Joe: Rise of the Cobra</a></li>
</ul>
<p>More to come&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leonardteo.com/2010/02/cg-channel-goes-video-based/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New CG Channel website</title>
		<link>http://www.leonardteo.com/2010/02/new-cg-channel-website/</link>
		<comments>http://www.leonardteo.com/2010/02/new-cg-channel-website/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 14:12:46 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.leonardteo.com/?p=172</guid>
		<description><![CDATA[This is awesome. Yesterday, we launched the brand new CG Channel website. CG Channel is an online destination for entertainment artists. Our mission is to inform, inspire and empower our [...]]]></description>
			<content:encoded><![CDATA[<p>This is awesome. Yesterday, we launched the brand new <a href="http://www.cgchannel.com">CG Channel</a> website.</p>
<p><a href="http://www.leonardteo.com/wp-content/uploads/2010/02/cgchannelfinal.jpg"><img class="aligncenter size-medium wp-image-173" title="cgchannelfinal" src="http://www.leonardteo.com/wp-content/uploads/2010/02/cgchannelfinal-399x289.jpg" alt="" width="399" height="289" /></a></p>
<p>CG Channel is an online destination for entertainment artists. Our mission is to <em>inform</em>, <em>inspire </em>and <em>empower </em>our viewers. For over a decade, CG Channel has served the entertainment production industry with news, features and community services.</p>
<p>What makes CG Channel different from other sites?</p>
<p><strong>High quality video content</strong> – CG Channel features impactful interviews and insights from professional production artists.</p>
<p><strong>Broadcasting worldwide from Hollywood</strong> – With access to hundreds of studios and artists, CG Channel has access to some of the best artists and studios for unique, insightful content.</p>
<p><strong>Focus on education and training</strong> – CG Channel is part of the Gnomon group of companies, which is focused on inspiring and empowering entertainment production artists. The Gnomon group of companies includes:</p>
<ul style="list-style-type: disc; list-style-image: none; list-style-position: outside; margin-left: 20px; margin-bottom: 0px; padding-bottom: 0px;">
<li><a href="http://www.gnomonschool.com/">Gnomon School of Visual Effects</a> – The premiere school for digital entertainment artists, based in Hollywood, CA.</li>
<li><a href="http://www.thegnomonworkshop.com/">The Gnomon Workshop</a> – Video training products for digital entertainment artists.</li>
</ul>
<p><strong>Competitions hosted by top-level professionals</strong> – CG Channel runs monthly digital art contests hosted by top-level industry professionals, giving an opportunity for developing artists to learn from the pros.</p>
<p>So check it out. Head on over to <a href="http://www.cgchannel.com">www.cgchannel.com</a>.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">
<p><strong>High quality video content</strong> – CG Channel features impactful interviews and insights from professional production artists.</p>
<p><strong>Broadcasting worldwide from Hollywood</strong> – With access to hundreds of studios and artists, CG Channel has access to some of the best artists and studios for unique, insightful content.</p>
<p><strong>Focus on education and training</strong> – CG Channel is part of the Gnomon group of companies, which is focused on inspiring and empowering entertainment production artists. The Gnomon group of companies includes:</p>
<ul style="list-style-type: disc; list-style-image: none; list-style-position: outside; margin-left: 20px; margin-bottom: 0px; padding-bottom: 0px;">
<li><a href="http://www.gnomonschool.com/">Gnomon School of Visual Effects</a> – The premiere school for digital entertainment artists, based in Hollywood, CA.</li>
<li><a href="http://www.thegnomonworkshop.com/">The Gnomon Workshop</a> – Video training products for digital entertainment artists.</li>
</ul>
<p><strong>Competitions hosted by top-level professionals</strong> – CG Channel runs monthly digital art contests hosted by top-level industry professionals, giving an opportunity for developing artists to learn from the pros.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.leonardteo.com/2010/02/new-cg-channel-website/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Peoples Church of Montreal Website</title>
		<link>http://www.leonardteo.com/2009/12/peoples-church-of-montreal-website/</link>
		<comments>http://www.leonardteo.com/2009/12/peoples-church-of-montreal-website/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 13:18:42 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[Rambling]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.leonardteo.com/?p=153</guid>
		<description><![CDATA[I&#8217;m pleased to say that the new Peoples Church of Montreal website that I got to work on has finally gone live at www.peoplesmontreal.org. The website was built with WordPress [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m pleased to say that the new Peoples Church of Montreal website that I got to work on has finally gone live at <a href="http://www.peoplesmontreal.org">www.peoplesmontreal.org</a>. The website was built with WordPress and a theme which I designed and developed from scratch with PHP and JQuery. I built it using WordPress so that others in the church can update the website on their own. Jonathan Sturgeon, the Media Director for the church has been shooting videos of all the sermons and is making them available through Vimeo on the website.</p>
<p><a href="http://www.peoplesmontreal.org"><img class="aligncenter size-medium wp-image-155" title="peoplesmontreal" src="http://www.leonardteo.com/wp-content/uploads/2009/12/peoplesmontreal-400x327.jpg" alt="" width="400" height="327" /></a><a href="http://www.peoplesmontreal.org"></a></p>
<p><a href="http://www.peoplesmontreal.org">Peoples Church of Montreal website</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.leonardteo.com/2009/12/peoples-church-of-montreal-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
