<?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>Poetry of Programming</title>
	<atom:link href="http://www.poetryofprogramming.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.poetryofprogramming.com</link>
	<description>Because coding is art</description>
	<lastBuildDate>Wed, 15 Apr 2009 15:05:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>10 short answers to frequently asked questions about Symfony</title>
		<link>http://www.poetryofprogramming.com/symfony/10-short-answers-to-frequently-asked-questions-about-symfony/</link>
		<comments>http://www.poetryofprogramming.com/symfony/10-short-answers-to-frequently-asked-questions-about-symfony/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 14:57:21 +0000</pubDate>
		<dc:creator>Krzysztof Karolczak</dc:creator>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony 1.0]]></category>
		<category><![CDATA[Symfony 1.1]]></category>
		<category><![CDATA[Symfony 1.2]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.poetryofprogramming.com/?p=39</guid>
		<description><![CDATA[I wanted to put together few simple answers to problems which I came across when browsing through Symfony related forums and mailing lists. The list is of course open and please feel free to write a comment with your own question. I&#8217;ll be glad to help if I only can  .
Remark: The answers generally [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to put together few simple answers to problems which I came across when browsing through Symfony related forums and mailing lists. The list is of course open and please feel free to write a comment with your own question. I&#8217;ll be glad to help if I only can <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .<span id="more-39"></span></p>
<p style="text-align: justify;"><strong>Remark:</strong> The answers generally apply to all the versions of Symfony if not specified otherwise. And the exemplary code uses Propel.</p>
<h4 style="text-align: justify;">1. How to gain access to the Request object outside the action?</h4>
<p style="text-align: justify;">In any place in your Symfony project you can initialize an instance of sfContext by simply calling <em>sfContext::getInstance() </em>and use it to retrieve other important object including the Request.</p>
<p style="text-align: justify;">For example:</p>
<p style="text-align: justify; padding-left: 30px;">$context = sfContext::getInstance();<br />
 $context-&gt;getActionName();<br />
 $context-&gt;getActionStack();<br />
 $context-&gt;getController();<br />
 $context-&gt;getDatabaseConnection();<br />
 $context-&gt;getLogger();<br />
 $context-&gt;getModuleDirectory();<br />
 $context-&gt;getModuleName();<br />
 $context-&gt;getRequest();<br />
 $context-&gt;getResponse();<br />
 $context-&gt;getUser();</p>
<h4 style="text-align: justify;">2. How to make  an <em>object_select_tag</em> create a drop down containing a sorted list?</h4>
<p style="text-align: justify;">Let&#8217;s say that we have an object <em>$record</em> with <em>person_id</em> field, which is a foreign reference to a Person class. We want in our form to display <em>object_select_tag</em> that will contain all the possible choices of <em>Person</em> objects sorted for example by their <em>name</em>.</p>
<p style="text-align: justify;">By calling:</p>
<p style="text-align: justify; padding-left: 30px;">object_select_tag ($record, &#8216;getPersonId&#8217;);</p>
<p style="text-align: justify;">We only get a list sorted by id (probably)  &#8211; because <em>object_select_tag</em> uses <em>PersonPeer::doSelect()</em> by default.</p>
<p style="text-align: justify;">So the solution is:</p>
<p style="text-align: justify; padding-left: 30px;">object_select_tag ($record, &#8216;getPersonId&#8217;, array (</p>
<p style="text-align: justify; padding-left: 60px;">&#8216;related_class&#8217; =&gt; &#8216;Person&#8217;,<br />
 <strong> &#8216;peer_method&#8217; =&gt; &#8216;doOrderedSelect&#8217;,</strong><br />
 &#8216;include_blank&#8217; =&gt; true)</p>
<p style="text-align: justify; padding-left: 30px;">) ;</p>
<p style="text-align: justify;">And we just need to create a <em>doOrderedSelect</em> method in <em>PersonPeer </em>class, that might look like this:</p>
<p style="padding-left: 30px;">public static function doOrderedSelect($c = &#8221;)<br />
 {</p>
<p style="padding-left: 60px;">If(!$c)<br />
 $c = new Criteria();</p>
<p style="padding-left: 60px;">$c-&gt;addAscendingOrderByColumn(PersonPeer::NAME);<br />
 return parent::doSelect($c);</p>
<p style="padding-left: 30px;">}</p>
<p style="text-align: justify;">And remember that for all of that to work <em>Person</em> class has to have a __toString() method [see point 3].</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-5856107143683355";
google_ad_slot = "0824560404";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<h4 style="text-align: justify;">3. The magic <em>__toString() </em>method.</h4>
<p style="text-align: justify;">The most commonly used PHP5 magic method  in Symfony projects is the <em>__toString()</em> method, which specifies what value should be returned when the given object is cast to string (or simply used as a string).</p>
<p style="text-align: justify;">It is a very natural programming approach to specify what &#8216;natural language phrase&#8217; should be associated with an object instance.  A short example to illustrate that:</p>
<p style="text-align: justify; padding-left: 30px;">class Person extends BasePerson<br />
 {</p>
<p style="text-align: justify; padding-left: 60px;">public function __toString()<br />
 {</p>
<p style="text-align: justify; padding-left: 90px;">return $this-&gt;getName() . &#8216; &#8216; . $this-&gt;getSurname();</p>
<p style="text-align: justify; padding-left: 60px;">}</p>
<p style="text-align: justify; padding-left: 30px;">}</p>
<p style="text-align: justify;">And now we can print out the name and surname of our <em>Person</em> class instance &#8211; let&#8217;s say <em>$example_person &#8211; </em>simply by writing <em>echo </em><em>$example_person</em>.</p>
<p style="text-align: justify;">The <em>__toString()</em> method is used by some of the Symfony form helpers and it&#8217;s usually worth spending a bit extra time to create those methods in our model &#8211; just for the sake of code readabilty.</p>
<p style="text-align: justify;">But be careful when using PHP version older then 5.2 -because  <em>__toString()</em> method was only called when it was directly combined with echo() or print(), which might cause unexpected results sometimes.</p>
<h4>4. How to create a paginated list in Symfony?</h4>
<p>Symfony comes with a <em>sfPropelPager </em>which handles all the paging for us. I hope the preceding code is self-explanatory.</p>
<p>The action:</p>
<p style="padding-left: 30px;">public function executeList()<br />
 {</p>
<p style="padding-left: 60px;">&#8230;</p>
<p style="padding-left: 60px;">$rows_per_page = sfConfig::get(&#8217;app_rows_per_page&#8217;); // Now you can set the number of rows per page in <em>your_app/config/app.yml</em></p>
<p style="padding-left: 60px;">$page = $this-&gt;getRequestParameter(&#8217;page&#8217;, 1);</p>
<p style="padding-left: 60px;">$pager = new sfPropelPager(&#8217;YourClass&#8217;, $rows_per_page);<br />
 $pager-&gt;setCriteria($c);<br />
 $pager-&gt;setPage($page);<br />
 $pager-&gt;init();<br />
 $this-&gt;pager = $pager;</p>
<p style="padding-left: 30px;">}</p>
<p>The template:</p>
<p style="padding-left: 30px;">&lt;?php if ($pager-&gt;haveToPaginate()): ?&gt;<br />
 &lt;div class=&#8221;pagination&#8221;&gt;</p>
<p style="padding-left: 30px;">&lt;?php echo link_to(&#8217;&lt;&lt; &#8216;, &#8216;example/list?page=&#8217;.$pager-&gt;getFirstPage()) ?&gt;<br />
 &lt;?php echo link_to(&#8217; &lt;&#8217;, &#8216;example/list?page=&#8217;.$pager-&gt;getPreviousPage()) ?&gt;</p>
<p style="padding-left: 30px;">&lt;?php $links = $pager-&gt;getLinks(); foreach ($links as $page): ?&gt;<br />
 &lt;?php echo ($page == $pager-&gt;getPage()) ? $page : link_to($page, &#8216;example/list?page=&#8217;.$page) ?&gt;<br />
 &lt;?php endforeach ?&gt;</p>
<p style="padding-left: 30px;">&lt;?php echo link_to(&#8217;&gt; &#8216;, &#8216;example/list?page=&#8217;.$pager-&gt;getNextPage()) ?&gt;<br />
 &lt;?php echo link_to(&#8217; &gt;&gt;&#8217;, &#8216;example/list?page=&#8217;.$pager-&gt;getLastPage()) ?&gt;</p>
<p style="padding-left: 30px;">&lt;/div&gt;<br />
 &lt;?php endif; ?&gt;</p>
<p style="padding-left: 30px; text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-5856107143683355";
google_ad_slot = "0824560404";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<h4>5. How to use pager with a custom peer method like <em>doSelectJoinAll()</em>?</h4>
<p>Let&#8217;s assume that we have a pager used to display a list of objects with foreign references and we want to sort it by one of the fields from a foreign table. We&#8217;ll need to use o <em>join</em> for that and it would be nice if we could use one of the generated methods like <em>doSelectJoin*()</em>, e.g. <em>doSelectJoinAll()</em>.</p>
<p>The solution is very simple. Before calling  <em>$pager-&gt;init()</em> use the pager&#8217;s <em>setPeerMethod().</em> In  our case that would be:</p>
<p style="padding-left: 30px;">$pager-&gt;setPeerMethod(&#8217;doSelectJoinAll&#8217;);</p>
<h4>6. Problem with storing dates before year 1970 in some databases.</h4>
<p>It was an issue for Symfony 1.0.X &#8211; don&#8217;t know if it applies to other versions as well.</p>
<p>For some db the data type <em>date</em> didn&#8217;t work as expected for dates prior to 01.01.1970. There exist a special, additional date type <em>bu_date</em> that you have to use in your <em>schema.yml</em>.</p>
<p style="padding-left: 30px;">date_of_birth:  {  type: bu_date  }</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-5856107143683355";
google_ad_slot = "0824560404";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<h4 style="text-align: justify;">7. JavaScript in Ajax response call is not executed.</h4>
<p>In Symfony if the response code of the Ajax call contains JavaScript it won&#8217;t be executed by default &#8211; for security reasons.</p>
<p>You need to explicitly declare for Ajax helpers the ability to execute scripts in remote responses &#8211; which can be done with the <em>script</em> option.</p>
<p>Using the example from Symfony&#8217;s documentation:</p>
<p style="padding-left: 30px;">&lt;?php<br />
 // If the response of the post/delete action contains JavaScript,<br />
 // allow it to be executed by the browser<br />
 echo link_to_remote(&#8217;Delete this post&#8217;, array(<br />
 &#8216;update&#8217; =&gt; &#8216;feedback&#8217;,<br />
 &#8216;url&#8217;    =&gt; &#8216;post/delete?id=&#8217;.$post-&gt;getId(),<br />
 &#8217;script&#8217; =&gt; true,<br />
 )) ?&gt;</p>
<p style="text-align: left;"><strong>8. 9. 10.</strong> &#8230; are in progress, and I&#8217;m open to <strong>your</strong> questions <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.poetryofprogramming.com/symfony/10-short-answers-to-frequently-asked-questions-about-symfony/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting the web server to gain access to symfony_data/web/sf/ directory</title>
		<link>http://www.poetryofprogramming.com/symfony/setting-the-web-server-to-gain-access-to-symfony_datawebsf-directory/</link>
		<comments>http://www.poetryofprogramming.com/symfony/setting-the-web-server-to-gain-access-to-symfony_datawebsf-directory/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 16:56:29 +0000</pubDate>
		<dc:creator>Krzysztof Karolczak</dc:creator>
				<category><![CDATA[Installation]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony 1.0]]></category>
		<category><![CDATA[Symfony 1.1]]></category>
		<category><![CDATA[Symfony 1.2]]></category>
		<category><![CDATA[vhost]]></category>

		<guid isPermaLink="false">http://www.poetryofprogramming.com/?p=25</guid>
		<description><![CDATA[The happiness of running the first Symfony project is very often spoiled by a message displayed on the first Symfony-based web page:
Congratulations! You have successfully created your symfony project.
Project setup successful
This project uses the symfony libraries. If you see no image in this page, you may need to configure your web server so that it [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><span class="MsgBodyText">The happiness of running the first Symfony project is very often spoiled by a message displayed on the first Symfony-based web page:</span></p>
<p style="padding-left: 30px; text-align: justify;"><em>Congratulations! You have successfully created your symfony project.</em></p>
<p style="padding-left: 30px; text-align: justify;"><em>Project setup successful</em></p>
<p style="padding-left: 30px; text-align: justify;"><em>This project uses the symfony libraries. If you see no image in this page, you may need to configure your web server so that it gains access to the symfony_data/web/sf/ directory.</em></p>
<p style="text-align: justify;">The proper configuration of the web server seems to be the most troublesome part of Symfony installation. But fortunately there are several quick ways to solve that problem. This short guide will describe three of them from the perspective of an Apache web server user.<span id="more-25"></span></p>
<p style="text-align: justify;">I&#8217;m assuming that you have Symfony already properly installed (if not &#8211; the <strong><a href="http://www.poetryofprogramming.com/symfony/install-symfony-framework-xp-vista-wamp/" target="_blank">installation guide is here</a></strong>). I&#8217;m working on a <strong><a href="http://www.wampserver.com/en/" target="_blank">WAMP</a> installation</strong> of Apache+MySQL+PHP, so the directory paths in my examples will reflect that (but the guide should work for any Apache based configuration).</p>
<p><strong>Method 1 &#8211; setting a virtual host</strong></p>
<p style="text-align: justify;">This is the most recommended method of setting up your working environment (in fact it is the only <em><strong>real</strong></em> method out there &#8211; the other described below are just workarounds ) &#8211; you should always create a virtual host for every application. This guide will teach you how to configure your web server to cope with one project (a multi-application <em>vhost </em> example is coming up soon <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).</p>
<p style="text-align: justify;">First &#8211; find your apache config directory (in my WAMP install it&#8217;s <em>C:\wamp\bin\apache\apache2.2.6\conf\</em>) and open the <em>httpd-vhosts.conf</em> (which is in the sub-directory <em>extra</em> &#8211; <em>C:\wamp\bin\apache\apache2.2.6\conf\extra</em>). Delete or comment out all the lines  (by adding &#8216;#&#8217; at the beginning of each one) if you&#8217;re not sure what they do (if you haven&#8217;t written them they are probably just examples of <em>vhost </em>configuration).</p>
<p class="note" style="text-align: justify;">In Symfony 1.2 (1.1 also?) a sample <em>vhost</em> config file is created automatically for every project you generate. It can be found in <em>config/vhost.sample</em> &#8211; feel free to copy/paste that code instead of the below example.</p>
<p style="text-align: justify;">Now add at the end of the file your virtual host config which should look similar to this (it&#8217;s just one of possible ways of configuring  a <em>vhost</em> &#8211; you may find other configurations that achieve the same thing but look different &#8211; they all are correct as long as they work, right? <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ):</p>
<p style="padding-left: 30px;"><em>NameVirtualHost *:80</em></p>
<p style="padding-left: 30px;"><em>Listen 127.0.0.2:80</em></p>
<p style="padding-left: 30px;"><em>&lt;VirtualHost 127.0.0.2:80&gt;</em></p>
<p style="padding-left: 60px;"><em>ServerName your_application_name<br />
 DocumentRoot &#8220;c:\wamp\www\your_project\web&#8221;<br />
 </em><em>DirectoryIndex index.php</em></p>
<p><em> </em></p>
<p style="padding-left: 60px;"><em>&lt;Directory &#8220;c:\wamp\www\</em><em>your_project\</em><em>web&#8221;&gt;</em></p>
<p style="padding-left: 90px;"><em>AllowOverride All<br />
 Allow from All</em></p>
<p style="padding-left: 60px;"><em>&lt;/Directory&gt;</em></p>
<p style="padding-left: 60px;"><em>Alias /sf &#8220;c:\wamp\bin\php\php5.2.5\PEAR\data\symfony\web\sf&#8221;</em></p>
<p style="padding-left: 60px;"><em>&lt;Directory &#8220;c:\wamp\bin\php\php5.2.5\PEAR\data\symfony\web\sf&#8221;&gt;</em></p>
<p style="padding-left: 90px;"><em>AllowOverride All<br />
 Allow from All</em></p>
<p style="padding-left: 60px;"><em>&lt;/Directory&gt;</em></p>
<p style="padding-left: 30px;"><em>&lt;/VirtualHost&gt;</em></p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-5856107143683355";
google_ad_slot = "0824560404";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p style="text-align: justify;">In lines <em>&#8216;</em><em> Alias /sf &#8220;c:\wamp\bin\php\php5.2.5\PEAR\data\symfony\web\sf&#8221; </em><em>&#8216;</em> and <em>&#8216; </em><em>&lt;Directory &#8220;c:\wamp\bin\php\php5.2.5\PEAR\data\symfony\web\sf&#8221;&gt; </em><em>&#8216; </em>replace my path with the path to your <em>symfony/web/sf</em> dir. And do the same with lines <em>&#8216; </em><em>DocumentRoot &#8220;c:\wamp\www\your_project\web&#8221;</em><em> &#8216; </em>and<em> &#8216; &lt;Directory &#8220;c:\wamp\www\your_project\web&#8221;&gt;</em><em> &#8216; </em>changing the path to one that points to the <em>web </em>directory in your project.</p>
<p style="text-align: justify;">And you should also specify the name of your virtual server by modifying <em>&#8216;your_application_name&#8217;</em> in the <em>&#8216;ServerName your_application_name&#8217; </em>line.</p>
<p style="text-align: justify;">Make sure that in the <em>httpd.conf</em> file<em> </em>(main Apache config file located in a directory like <em>C:\wamp\bin\apache\apache2.2.6\conf) </em>the line &#8216;<em>Include conf/extra/httpd-vhosts.conf</em>&#8216; is uncommented (no &#8216;#&#8217; before it).</p>
<p style="text-align: justify;">Now we need to declare our own domain locally, by adding a line like &#8216;<em>127.0.0.2 </em><em>your_application_name&#8217;</em> to the <em>host</em> file (located in <em>C:\WINDOWS\system32\drivers\etc</em>). Just make sure that you add your line after &#8216;<em>127.0.0.1 localhost</em>&#8216; (which should be in fact the first line). You may also need admin privileges to modify that file.</p>
<p style="text-align: justify;">Now &#8211; after an Apache restart &#8211; if you type in your browser http://your_application_name/ your Symfony welcoming page should have all the graphics displayed correctly.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-5856107143683355";
google_ad_slot = "0824560404";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p><strong>Method 2 &#8211; project freezing</strong></p>
<p style="text-align: justify;">You can obtain a ready-to-deploy package from your Symfony project by using the <em>freeze</em> command. If you execute in the root of your project:</p>
<p style="padding-left: 30px;"><em>symfony freeze [c:/path/to/your/symfony/data/dir]</em></p>
<p style="text-align: justify;">All Symfony core files will be copied to the current project, including the ones that where missing in the <em>web/sf</em> directory. The freeze command also changes some paths in your project configuration so it will now address the Symfony libraries that were also copied to your project not the global ones. The main drawback is that if you want to upgrade Symfony you&#8217;ll have to <em>unfreeze</em> (command opposite to freeze) and <em>freeze</em> again all your projects or copy/overwrite files manually. And there may be some path issues if your project is not in the web root of your web server directory.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-5856107143683355";
google_ad_slot = "0824560404";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p><strong>Method 3 &#8211; the stupid way</strong></p>
<p style="text-align: justify;">If the above methods are not working for you &#8211; just go ahead and copy the <em>symfony_data_path/web/sf/ </em>directory to <em>your_project_path/web/</em> (so in my case that would be copying <em>C:\wamp\bin\php\php5.2.5\PEAR\data\symfony\web\sf </em>to the <em>C:\wamp\www\your_project\web</em> directory). As before the downside of this workaround is that after updating Symfony you will have to manually recopy that folder again to all your projects and there probably will be some path issues when accessing plugin assets or when using absolute paths in links (but you probably won&#8217;t even notice if you&#8217;ll always use symfony helpers for handling your links).</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-5856107143683355";
google_ad_slot = "0824560404";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p><!--more--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poetryofprogramming.com/symfony/setting-the-web-server-to-gain-access-to-symfony_datawebsf-directory/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>PHP Maximum execution time exceeded error workaround</title>
		<link>http://www.poetryofprogramming.com/php/php-maximum-execution-time-exceeded-error-workaround/</link>
		<comments>http://www.poetryofprogramming.com/php/php-maximum-execution-time-exceeded-error-workaround/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 13:01:03 +0000</pubDate>
		<dc:creator>Krzysztof Karolczak</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.poetryofprogramming.com/uncategorized/php-maximum-execution-time-exceeded-error-workaround/</guid>
		<description><![CDATA[The Maximum execution time of 30 seconds exceeded error can be annoying when executing &#8220;heavy&#8221; PHP scripts (involving lots of data processing) and it&#8217;s also a frequent follow-up of running Apache web servers on Windows machines   (for example when testing Symfony projects on your local PC). But no worries!   &#8211; there [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">The <em>Maximum execution time of 30 seconds exceeded </em>error can be annoying when executing &#8220;heavy&#8221; PHP scripts (involving lots of data processing) and it&#8217;s also a frequent follow-up of running Apache web servers on Windows machines <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  (for example when testing Symfony projects on your local PC). But no worries! <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  &#8211; there are couple of easy ways to solve this problem. <span id="more-12"></span></p>
<p align="justify"><strong>Solution 1 &#8211; When we have access to PHP configurations files. </strong></p>
<p align="justify">If  we can edit the PHP config files the problem boils down to changing one variable in PHP.ini. Usually the right PHP.ini can be found in the main PHP dir (for example in my PHP WAMP intallation it&#8217;s located in <em>C:\wamp\bin\php\php5.2.5)</em>. And now we just need to open it and look for the line:</p>
<blockquote><p>max_execution_time = 30</p></blockquote>
<p align="justify">Changing the 30 seconds setting to something like 120 seconds should do the trick. And all we need to do now is to restart the web server. <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-5856107143683355";
google_ad_slot = "0824560404";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p><strong>Solution 2 &#8211; On a remote server.</strong></p>
<p align="justify">There is a nice PHP function called <span class="methodname"><em><strong><strong>set_time_limit ( </strong></strong>int $seconds<strong><strong> )</strong></strong></em>, every time it&#8217;s called it sets the timeout counter with the given value, which means that the script will now be able to run for <em>$seconds</em>. Execution of <em><strong>set_time_limit(0) </strong></em>removes the PHP timeout limit.</span></p>
<p align="justify">Unfortunately this will not work if PHP is running in <em>safe mode</em>. For further details consult the <a href="http://php.net/set_time_limit" target="_blank">PHP manual</a>.</p>
<p><strong>Other timeout possibilities <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </strong></p>
<p align="justify">It&#8217;s also worth mentioning that most of webservers have their own timeout counters &#8211; e.g. in Apache it&#8217;s set to 300 s by default. 6 minutes is usually plenty of time but it still can be changed if we desire so <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . The timeout setting can be found in <em>httpd-default.conf </em>file which is located with the rest of Apache conf files (e.g. my path is <em>C:\wamp\bin\apache\apache2.2.6\conf\extra</em>).</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-5856107143683355";
google_ad_slot = "0824560404";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.poetryofprogramming.com/php/php-maximum-execution-time-exceeded-error-workaround/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Symfoclipse &#8211; Symfony Development Tools for Eclipse</title>
		<link>http://www.poetryofprogramming.com/symfony/symfoclipse-symfony-development-tools-for-eclipse/</link>
		<comments>http://www.poetryofprogramming.com/symfony/symfoclipse-symfony-development-tools-for-eclipse/#comments</comments>
		<pubDate>Mon, 05 May 2008 18:56:11 +0000</pubDate>
		<dc:creator>Krzysztof Karolczak</dc:creator>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[PDT]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony 1.0]]></category>

		<guid isPermaLink="false">http://www.poetryofprogramming.com/symfony/symfoclipse-symfony-development-tools-for-eclipse/</guid>
		<description><![CDATA[Symfoclipse is an optimal Symfony Framework development environment integrated with Eclipse. Easy to install and use is probably the best choice for anyone who has just started developing projects in Symfony.
The plug-in ads a Symfony view to Eclipse which extends the normal PHP Perspective in PDT (PDT stands for PHP Development  		Tools) an gives [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><a href="http://noy.cc/symfoclipse/" target="_blank"><strong>Symfoclipse</strong></a> is an optimal Symfony Framework development environment integrated with Eclipse. Easy to install and use is probably the best choice for anyone who has just started developing projects in Symfony.</p>
<p style="text-align: justify;">The plug-in ads a Symfony view to Eclipse which extends the normal PHP Perspective in PDT (PDT stands for PHP Development  		Tools) an gives us a direct access to all framework-defined actions plus there&#8217;s a helpful YAML editor included for Symfony configuration files ( and last but not least a nice &#8216;<em>s&#8217;</em> icon appears next to Symfony projects <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ).<span id="more-8"></span></p>
<p class="note" align="justify"><strong>What is <a title="Eclipse" href="http://www.eclipse.org/" target="_blank">Eclipse</a>? </strong>It&#8217;s a big open-source community project aimed to create a &#8220;<em>development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the lifecycle</em>&#8220;. Especially Java developers will find it useful (or even as a must-have software), but it also offers an extensive IDE for C/C++, PHP&#8230; and much more.</p>
<p class="important" align="center"><strong>It seems that as for the moment Symfoclipse works properly only with Symfony 1.0.X.</strong><br />
 You can still use it with 1.1 or later but you won&#8217;t get much more than a YML editor.</p>
<p><strong>0. You&#8217;ll definitely need Symfony up and running <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </strong></p>
<p>( <strong><a href="http://www.poetryofprogramming.com/symfony/install-symfony-framework-xp-vista-wamp/" target="_blank">Symfony Framework installation guide</a></strong>. )</p>
<p align="justify"><strong>1a. All-In-One Pack = Eclipse + PDT &#8211; for those who don&#8217;t have Eclipse installed.</strong></p>
<p align="justify">As said before Symfoclipse needs Eclipse with a PDT plug-in configured. The easiest way to do that is to download a All-In-One bundle which works out of the box ( I strongly recommend getting a Release Build from the<strong> <a title="PDT Download Page" href="http://download.eclipse.org/tools/pdt/downloads/" target="_blank">PDT download</a></strong> | <a title="PDT Eclipse Home" href="http://www.eclipse.org/pdt/" target="_blank"><strong>PDT Home</strong></a> ). You&#8217;ll also need to have a Java SE 5.0+ installed on your PC (you probably have &#8211; but it maybe worth <strong><a href="http://java.sun.com/javase/downloads/index.jsp" target="_blank">upgrading</a> </strong>anyway). The install process is quite straight forward &#8211; just extract the zip file and your done.</p>
<p align="justify">Getting used to Eclipse layout and functionality may take a while, but there are many great manuals out there. And it&#8217;s worth it.</p>
<p><strong>1b. Installing PDT &#8211; if you already have Eclipse.</strong></p>
<p align="justify">If you have Eclipse you can install PDT by its update manager. Go to <em>Help <img src="http://www.eclipse.org/eclipse.org-common/themes/Phoenix/images/arrow.gif" alt="" /> Software Updates <img src="http://www.eclipse.org/eclipse.org-common/themes/Phoenix/images/arrow.gif" alt="" /> Find and Install</em>. Choose the &#8220;<em>Search For New 	Feature to Install</em>&#8220;, add a new site (&#8221;<em>New Remote Site&#8230;&#8221;</em>) with the following link 	&#8220;<em>http://download.eclipse.org/tools/pdt/updates/</em>&#8221; and press<em> Next </em>to 	start the update process.  In case of any problems refer to the <a href="http://wiki.eclipse.org/IRC_FAQ#How_do_I_install_a_project_with_multiple_dependencies.3F" target="_blank">Eclipse Wiki</a>.</p>
<p><strong>2. Downloading and installing Symfoclipse</strong></p>
<p align="justify">The installation process is the same as with most Eclipse plug-ins and it&#8217;s done via the update manager. Go to <em>Help <img src="http://www.eclipse.org/eclipse.org-common/themes/Phoenix/images/arrow.gif" alt="" /> Software Updates <img src="http://www.eclipse.org/eclipse.org-common/themes/Phoenix/images/arrow.gif" alt="" /> Find and Install</em>. Choose the &#8220;<em>Search For New 	Feature to Install</em>&#8220;, add a new site with the 	&#8220;<em>http://noy.cc/symfoclipse/</em>&#8221; link and press <em>Next </em>to 	start the updating. After the download has finished you&#8217;ll need to restart Eclipse and you&#8217;re done.</p>
<p align="center"><script type="text/javascript"><!--
google_ad_client = "pub-5856107143683355";
google_ad_slot = "0824560404";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<h4>Symfoclipse functionality</h4>
<p><strong>Symfony View</strong></p>
<p align="justify">It&#8217;s a modified <em>PHP Exlporer</em> view and it can be activated by selecting <em>Symfony View</em> in <em>Show View</em><em> </em>(<em>Window </em><em><img src="http://www.eclipse.org/eclipse.org-common/themes/Phoenix/images/arrow.gif" alt="" /></em><em> Show View </em><em><img src="http://www.eclipse.org/eclipse.org-common/themes/Phoenix/images/arrow.gif" alt="" /></em><em> Other</em>). It enables the CLI (Command Line Interface) commands to be accessible directly by right-clicking the Symfony directories in project listing.</p>
<p align="justify">So let&#8217;s start off with a first app. After creating a normal PHP project (<em>File <img src="http://www.eclipse.org/eclipse.org-common/themes/Phoenix/images/arrow.gif" alt="" /> New </em><em><img src="http://www.eclipse.org/eclipse.org-common/themes/Phoenix/images/arrow.gif" alt="" /> PHP Project</em>) we need to right-click it&#8217;s icon and select &#8220;<em>Init Project</em>&#8221; from the very bottom of the context menu. The result is the same as entering <em>symfony init-project</em> in the command line and you can notice all the messages appearing in the <em>Console</em>.</p>
<p align="justify">After the project initialization  you can right-click again ( notice the &#8216;<em>s</em>&#8216; icon is added <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) &#8211; you should see more Symfony Framework functions available.</p>
<p><strong>YAML Editor</strong></p>
<p align="justify">Symfoclipse adds also an YAML editor, which is very simple but has one functionality worth mentioning &#8211; a build-in auto validator that comes in handy when editing Symfony&#8217;s configuration files ( which tend do be easily buggable <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ).</p>
<p align="justify">The editors automatically opens <em>.yml</em> and <em>.yaml</em> files from our projects. If you want to open a different file with it you&#8217;ll need to right-click it an choose <em>Open With </em><em><img src="http://www.eclipse.org/eclipse.org-common/themes/Phoenix/images/arrow.gif" alt="" /></em><em> Symfoclipse YAML Editor</em></p>
<p align="center"><script type="text/javascript"><!--
google_ad_client = "pub-5856107143683355";
google_ad_slot = "0824560404";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p><!--more--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poetryofprogramming.com/symfony/symfoclipse-symfony-development-tools-for-eclipse/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Conversion table for px, pt, em and % in CSS</title>
		<link>http://www.poetryofprogramming.com/css/conversion-table-for-px-pt-em-and-in-css/</link>
		<comments>http://www.poetryofprogramming.com/css/conversion-table-for-px-pt-em-and-in-css/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 20:50:02 +0000</pubDate>
		<dc:creator>Krzysztof Karolczak</dc:creator>
				<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.poetryofprogramming.com/css/conversion-table-for-px-pt-em-and-in-css/</guid>
		<description><![CDATA[Are you wondering how to convert px to pt? When creating (or modifying) a style sheet have you ever tried to guess how many pixels corresponds to the size in points? I did  . That&#8217;s why I decided to put together a conversion table  . Enjoy.
Of course the table is here just to [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">Are you wondering how to convert px to pt? When creating (or modifying) a style sheet have you ever tried to guess how many pixels corresponds to the size in points? I did <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . That&#8217;s why I decided to put together a conversion table <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Enjoy.<span id="more-7"></span></p>
<p align="justify">Of course the table is here just to give you a rough idea which font size matches which. The actual display size depends on your browser, browser settings and font type used, but in most cases it should be just fine. Usually a quite good scaler for converting px to pt is a 0,75 multiplier (when comparing in a browser with font size set to standard).</p>
<p align="justify">The point of reference for relative values like ems and percent in this table is a standard font size &#8211; 16px (the 1em = 16px relation is set by default by most browsers when there&#8217;s no font-size declared beforehand).</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-5856107143683355";
google_ad_slot = "0824560404";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p><center></p>
<table class="MsoNormalTable" style="width: 65%; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0" width="65%">
<tbody>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #cf4200 none repeat scroll 0% 50%; width: 25%; text-align: left;" width="25%"><strong><span style="font-size: 8.5pt; font-family: Verdana; color: white;"> </span></strong><strong><span style="font-size: 8.5pt; font-family: Verdana; color: white;">Points</span></strong></td>
<td style="padding: 1.5pt 3.75pt; background: #cf4200 none repeat scroll 0% 50%; width: 25%; text-align: left;" width="25%"><strong><span style="font-size: 8.5pt; font-family: Verdana; color: white;">Pixels</span></strong></td>
<td style="padding: 1.5pt 3.75pt; background: #cf4200 none repeat scroll 0% 50%; width: 25%; text-align: left;" width="25%"><strong><span style="font-size: 8.5pt; font-family: Verdana; color: white;">Ems</span></strong><strong></strong></td>
<td style="padding: 1.5pt 3.75pt; background: #cf4200 none repeat scroll 0% 50%; width: 25%; text-align: left;" width="25%"><strong><span style="font-size: 8.5pt; font-family: Verdana; color: white;">Percent</span></strong></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">6pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">8px</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">0.5em</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">50%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">7pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">9px</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">0.55em</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">55%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">7.5pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">10px</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">0.625em</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">62.5%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">8pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">11px</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">0.7em</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">70%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">9pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">12px</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">0.75em</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">75%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">10pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">13px</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">0.8em</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">80%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">10.5pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">14px</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">0.875em</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">87.5%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">11pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">15px</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">0.95em</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">95%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #548dd4 none repeat scroll 0% 50%; width: 25%;" width="25%"><strong><span style="font-size: 8.5pt; font-family: Verdana; color: white;">12pt</span></strong></td>
<td style="padding: 1.5pt 3.75pt; background: #548dd4 none repeat scroll 0% 50%; width: 25%;" width="25%"><strong><span style="font-size: 8.5pt; font-family: Verdana; color: white;">16px</span></strong></td>
<td style="padding: 1.5pt 3.75pt; background: #548dd4 none repeat scroll 0% 50%; width: 25%;" width="25%"><strong><span style="font-size: 8.5pt; font-family: Verdana; color: white;">1em</span></strong></td>
<td style="padding: 1.5pt 3.75pt; background: #548dd4 none repeat scroll 0% 50%; width: 25%;" width="25%"><strong><span style="font-size: 8.5pt; font-family: Verdana; color: white;">100%</span></strong></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">13pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">17px</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">1.05em</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">105%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">13.5pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">18px</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">1.125em</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">112.5%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">14pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">19px</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">1.2em</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">120%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">14.5pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">20px</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">1.25em</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">125%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">15pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">21px</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">1.3em</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">130%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">16pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">22px</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">1.4em</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">140%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">17pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">23px</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">1.45em</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">145%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">18pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">24px</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">1.5em</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">150%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">20pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">26px</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">1.6em</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">160%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">22pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">29px</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">1.8em</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">180%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">24pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">32px</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">2em</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">200%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">26pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">35px</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">2.2em</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">220%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">27pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">36px</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">2.25em</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">225%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">28pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">37px</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">2.3em</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">230%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">29pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">38px</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">2.35em</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">235%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">30pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">40px</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">2.45em</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">245%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">32pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">42px</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">2.55em</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">255%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">34pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">45px</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">2.75em</span></td>
<td style="padding: 1.5pt 3.75pt; background: white none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">275%</span></td>
</tr>
<tr>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">36pt</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">48px</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">3em</span></td>
<td style="padding: 1.5pt 3.75pt; background: #eeeeee none repeat scroll 0% 50%; width: 25%; text-align: left;" width="25%"><span style="font-size: 8.5pt; font-family: Verdana; color: black;">300%</span></td>
</tr>
</tbody>
</table>
<p></center></p>
<p style="text-align: center;">
<script type="text/javascript"><!--
google_ad_client = "pub-5856107143683355";
google_ad_slot = "0824560404";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.poetryofprogramming.com/css/conversion-table-for-px-pt-em-and-in-css/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Install Symfony &#8211; Windows XP / Vista + WAMP</title>
		<link>http://www.poetryofprogramming.com/symfony/install-symfony-framework-xp-vista-wamp/</link>
		<comments>http://www.poetryofprogramming.com/symfony/install-symfony-framework-xp-vista-wamp/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 19:02:11 +0000</pubDate>
		<dc:creator>Krzysztof Karolczak</dc:creator>
				<category><![CDATA[Installation]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony 1.0]]></category>
		<category><![CDATA[Symfony 1.1]]></category>
		<category><![CDATA[Symfony 1.2]]></category>

		<guid isPermaLink="false">http://www.poetryofprogramming.com/uncategorized/instalacja-symfonii-windows-xp-wamp/</guid>
		<description><![CDATA[How to quickly and easily install Symfony Framework on Windows? A 15 minute guide that will let you start the fun right away!
I assume that you&#8217;re working on Windows XP or Vista and starting from scratch &#8211; that means without any WWW server configured on the machine &#8211; this guide will cover all of that [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">How to quickly and easily install Symfony Framework on Windows? A 15 minute guide that will let you start the fun right away!</p>
<p style="text-align: justify;">I assume that you&#8217;re working on Windows XP or Vista and starting from scratch &#8211; that means without any WWW server configured on the machine &#8211; this guide will cover all of that <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .  Enjoy! <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <span id="more-5"></span></p>
<p align="justify"><strong>What will we need?</strong></p>
<ul>
<li> <a title="WAMP" href="http://www.wampserver.com/" target="_blank">WAMP</a> (version 2.0 at the moment of writing)</li>
<li>and&#8230; that&#8217;s all! <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ul>
<p align="justify">Using WAMP we&#8217;ll install PEAR and Symfony right afterwards, but starting from the beginning:</p>
<p align="justify"><strong>Part 1 &#8211; Installing WAMP</strong></p>
<p align="justify"><a href="http://www.wampserver.com/" target="_blank">WAMP</a> is a self-installing, all-in-the-box package with Apache, MySQL and PHP 5 (5.2.8+) &#8211; and that&#8217;s exactly what we need (there is also PHPMyAdmin and SQLitemanager included which is nice and may come in handy). Of course it&#8217;s not the only pack like that available on the internet,  very similar to WAMP is for example <a title="XAMPP" href="http://www.apachefriends.org/en/xampp.html" target="_blank">XAMPP</a> &#8211; the choice is up to you. You could also install all the components manually&#8230; but what&#8217;s the point? <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p align="justify">WAMP will auto-extract it&#8217;s files (let&#8217;s say under C:\wamp) and start off without any problems. <em>Voila!</em> &#8211; a running server with default configuration! That was fast, wasn&#8217;t it</p>
<p align="justify">You can configure WAMP&#8217;s elements by clicking its tray icon. (You can also translate WAMP to a variety of languages &#8211; right click on the icon and see for yourself <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p class="note" align="justify">If your WAMP fails to start and you get a warning that port 80 is being used (and you don&#8217;t have another HTTP server running on the machine) &#8211; it can be Skype. Make sure that in Skype&#8217;s options (Advanced &gt;&gt; Connection) the checkbox about using port 80 as alternative port for incoming connections is not ticked.</p>
<p align="justify">Symfony needs PHP-XSL and Apache URL Rewrite Module to function normally (which are off by default on most installs). Let&#8217;s start by activating the Rewrite module &#8211; left click on WAMP&#8217;s tray icon and than in <em>Apache &gt;&gt; Apache Modules </em>menu select <em>rewrite_module</em> (server will automatically reboot). Now it&#8217;s time for XSL, as in the step before: &#8211; in <em>PHP &gt;&gt;</em> <em> PHP Extension</em> menu look for <em>php_xsl</em> and click it. But there is one more <em>php.ini</em> file, which WAMP sometimes won&#8217;t change (no clue why) &#8211; we need to do it by hand, let&#8217;s open: <em>C:\wamp\bin\php\php5.2.8\php.ini</em> and remove &#8220;;&#8221; from the line:</p>
<blockquote><p align="justify">;extension=php_xsl.dll</p>
</blockquote>
<p align="justify">Now we should add environment variables to have access to PHP i MySQL under the command line. Right-click on <em>My Computer</em>, than <em>Properties</em>. Switch to <em>Advanced </em>tab and click the <em>Environment Variables</em> button. At the end of variable <strong>PATH</strong> let&#8217;s add something like <em><strong>;C:\wamp\bin\php\php5.2.8;C:\wamp\bin\mysql\mysql5.0.45\bin</strong></em> (paths to MySQL and PHP files separated by a semicolon).</p>
<p align="justify"><strong>Part 2 &#8211; PEAR Install</strong></p>
<p align="justify"><a title="PEAR" href="http://pear.php.net" target="_blank"><strong>PEAR</strong></a> (<em><strong>P</strong>HP <strong>E</strong>xtension and <strong>A</strong>pplication <strong>R</strong>epository</em>) is a PHP extension distribution system. Installation files are bundled with PHP by default, so this won&#8217;t take us long.</p>
<p align="justify">In the WAMP&#8217;s PHP directory (ie. C:\wamp\bin\php\php5.2.8\) run the <strong>go-pear.bat</strong> file. Follow the installation steps and answer the questions, the default config should be just fine.</p>
<p>Inside the PHP directory the installer created a <strong>PEAR_ENV.reg</strong> file, which after double-clicking will add all the PEAR variables to the registry &#8211; no need to do it by hand.</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-5856107143683355";
google_ad_slot = "0824560404";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p><strong>Part 3 &#8211; Finally the Symfony </strong></p>
<p>Open the command line and write:</p>
<blockquote><p>&gt; pear channel-discover pear.symfony-project.com</p>
</blockquote>
<p>If everything goes wel, you&#8217;ll see:</p>
<p style="padding-left: 30px;"><em>Adding Channel &#8220;pear.symfony-project.com&#8221; succeeded<br />
 Discovery of channel &#8220;pear.symfony-project.com&#8221; succeeded</em></p>
<p>So the time has come, write the magic line:</p>
<blockquote><p>&gt; pear install symfony/symfony</p>
</blockquote>
<p>The download of the package shouldn&#8217;t take long (~2 MB), and PEAR automates the whole process.</p>
<p>Finally, to check if Symfony is installed correctly write:</p>
<p style="padding-left: 30px;"><em>symfony -V</em></p>
<p>Which should print out on the screen the version of Symfony you&#8217;ve just downloaded.</p>
<p><strong>Part 4 &#8211; Your first Symfony project</strong></p>
<p>Considering everything went smooth you can now write in the command line:</p>
<blockquote><p>&gt; cd C:\wamp\www<br />
 &gt; mkdir myproject<br />
 &gt; cd myproject<br />
 &gt; symfony init-project myproject<br />
 &gt; symfony init-app testapp</p>
</blockquote>
<p>For Symfony 1.2 the proper way to init a project is:</p>
<blockquote><p>&gt; symfony generate:project myproject<br />
 &gt; symfony generate:app &#8212;escaping-strategy=on &#8212;csrf-secret=Unique$ecret testapp</p>
</blockquote>
<p style="text-align: justify;">When calling the generate:app task, we have also passed two security related options:</p>
<ul>
<li><em>&#8211;escaping-strategy</em> &#8211; Enables output escaping to prevent <a href="http://en.wikipedia.org/wiki/Cross-site_scripting" target="_blank">XSS attacks</a></li>
<li><em>&#8211;csrf-secret</em> &#8211; Enables session tokens in forms to prevent <a href="http://en.wikipedia.org/wiki/CSRF" target="_blank">CSRF attacks</a></li>
</ul>
<p style="text-align: justify;">Yes, Symfony 1.2 will automatically protect us from the two most widespread vulnerabilities found on the web!</p>
<p><strong>Congratulations!</strong></p>
<p>The effects of your work can be seen at <em>http://127.0.0.1/</em>myproject/<em>web/</em></p>
<p><strong>And that&#8217;s that. I wish you many successful projects in Symfony <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<p><strong>If you want to move on from here (with your brand new Symfony Framework on-board <img src='http://www.poetryofprogramming.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ):</strong></p>
<ul style="text-align: justify;">
<li><a title="Setting the web server to gain access to symfony_data/web/sf/ directory" href="http://www.poetryofprogramming.com/symfony/setting-the-web-server-to-gain-access-to-symfony_datawebsf-directory/" target="_blank">See my guide on configuring Apache to work hand in hand with your Symfony applications.</a></li>
<li><a title="Symfony Framework" href="http://www.symfony-project.org/" target="_blank">Visit the Symfony official web page and enjoy the variety of guides, tutorials and well written documentation. </a></li>
</ul>
<p align="center"><script type="text/javascript"><!--
google_ad_client = "pub-5856107143683355";
google_ad_slot = "0824560404";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.poetryofprogramming.com/symfony/install-symfony-framework-xp-vista-wamp/feed/</wfw:commentRss>
		<slash:comments>51</slash:comments>
		</item>
	</channel>
</rss>
