<?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>Sébastien Barbieri's blog &#187; PHP</title>
	<atom:link href="http://blog.sbw.be/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sbw.be</link>
	<description>My life, my work, my projects</description>
	<lastBuildDate>Sat, 24 Dec 2011 00:12:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>All the assumption I want to remember in PHP</title>
		<link>http://blog.sbw.be/2011/05/26/all-the-assumption-i-want-to-remember-about-php/</link>
		<comments>http://blog.sbw.be/2011/05/26/all-the-assumption-i-want-to-remember-about-php/#comments</comments>
		<pubDate>Thu, 26 May 2011 09:33:00 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[truc de g33k]]></category>
		<category><![CDATA[empty]]></category>
		<category><![CDATA[false]]></category>
		<category><![CDATA[NULL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=491</guid>
		<description><![CDATA[Probably linked to some alcohol I drank to young, I always forget some key assumption in PHP. NULL is NULL NULL is EMPTY NULL is FALSE NULL has a sizeof 0 BUT FALSE is not NULL FALSE is EMPTY FALSE is FALSE FALSE has a sizeof 1 AND empty ARRAY is not NULL empty ARRAY [...]]]></description>
			<content:encoded><![CDATA[<p>Probably linked to some alcohol I drank to young, I always forget some key assumption in PHP.</p>
<p>NULL is NULL<br />
NULL is EMPTY<br />
NULL is FALSE<br />
NULL has a sizeof 0</p>
<p><strong>BUT</strong></p>
<p>FALSE is not NULL<br />
FALSE is EMPTY<br />
FALSE is FALSE<br />
FALSE has a sizeof 1</p>
<p><strong>AND</strong></p>
<p>empty ARRAY is not NULL<br />
empty ARRAY is EMPTY<br />
empty ARRAY is FALSE<br />
empty ARRAY has a sizeof 0</p>
<pre class="brush: php; title: ;">
$test=NULL;
if(is_null($test)){print(&quot;NULL is NULL&quot;);}else{print(&quot;NULL is not NULL&quot;);}
// NULL is NULL
if(empty($test)){print(&quot;NULL is EMPTY&quot;);}else{print(&quot;NULL is not EMPTY&quot;);}
// NULL is empty
if($test){print(&quot;NULL is TRUE&quot;);}else{print(&quot;NULL is FALSE&quot;);}
// NULL is FALSE
print(count($test));
// 0
$test=false;
if(is_null($test)){print(&quot;FALSE is NULL&quot;);}else{print(&quot;FALSE is not NULL&quot;);}
// FALSE is not NULL
if(empty($test)){print(&quot;FALSE is EMPTY&quot;);}else{print(&quot;FALSE is not EMPTY&quot;);}
// FALSE is EMPTY
if($test){print(&quot;FALSE is TRUE&quot;);}else{print(&quot;FALSE is FALSE&quot;);}
// FALSE is FALSE
print(count($test));
// 1
$test=array();
if(is_null($test)){print(&quot;empty ARRAY is NULL&quot;);}else{print(&quot;empty ARRAY is not NULL&quot;);}
// empty ARRAY is not NULL
if(empty($test)){print(&quot;empty ARRAY is EMPTY&quot;);}else{print(&quot;empty ARRAY is not EMPTY&quot;);}
// empty ARRAY is EMPTY
if($test){print(&quot;empty ARRAY is TRUE&quot;);}else{print(&quot;empty ARRAY is FALSE&quot;);}
// empty ARRAY is FALSE
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2011/05/26/all-the-assumption-i-want-to-remember-about-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Dojo v1.0</title>
		<link>http://blog.sbw.be/2011/04/06/open-dojo-v1-0/</link>
		<comments>http://blog.sbw.be/2011/04/06/open-dojo-v1-0/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 17:03:53 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[OpenDojo]]></category>
		<category><![CDATA[opendojo]]></category>
		<category><![CDATA[phing]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=475</guid>
		<description><![CDATA[Subject list for an open dojo / bbq session As Jedi phpunit and code coverage phing deployment svn and continuous integration As Padawan Working agile Scrum Now let&#8217;s decide a timeline]]></description>
			<content:encoded><![CDATA[<p>Subject list for an open dojo / bbq session</p>
<p>As Jedi</p>
<ul>
<li>phpunit and code coverage</li>
<li>phing deployment</li>
<li>svn and continuous integration</li>
</ul>
<p>As Padawan</p>
<ul>
<li>Working agile</li>
<li>Scrum</li>
</ul>
<p>Now let&#8217;s decide a timeline</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2011/04/06/open-dojo-v1-0/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Continuous Integration phpunit code coverage use a bit less than 2 Gigs !!!</title>
		<link>http://blog.sbw.be/2010/11/30/continuous-integration-phpunit-code-coverage-use-a-bit-less-than-2-gigs/</link>
		<comments>http://blog.sbw.be/2010/11/30/continuous-integration-phpunit-code-coverage-use-a-bit-less-than-2-gigs/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 18:28:08 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[freelance]]></category>
		<category><![CDATA[je bosse là]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[truc de g33k]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpunit]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=450</guid>
		<description><![CDATA[2 gigs !!! gasp&#8230; I had several: Generating code coverage report, this may take a moment.PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 21503527 bytes) in /usr/share/php/PHPUnit/Util/Report/Node/File.php on line 406 And here is how it started: At work we are using phpunit to test our framework, we flew from SimpleTest [...]]]></description>
			<content:encoded><![CDATA[<p><strong>2 gigs !!!</strong> <em>gasp</em>&#8230; </p>
<p>I had several:</p>
<p><strong>Generating code coverage report, this may take a moment.PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 21503527 bytes) in /usr/share/php/PHPUnit/Util/Report/Node/File.php on line 406<br />
</strong></p>
<p>And here is how it started:</p>
<p>At work we are using <a href="http://www.phpunit.de/">phpunit</a> to test our framework, we flew from <a href="http://www.simpletest.org/">SimpleTest</a> as there was no real integration with our tools and no real followup of the the product.</p>
<p>So to automate the test, as there is no &#8220;build&#8221; in php (interpreted vs compiled remember?) we ran it after each commit &#8230;</p>
<p>Until it tooks 30 minutes to run throught the whole set of tests&#8230;</p>
<p><span id="more-450"></span><br />
Then we decided to run it locally before comitting&#8230; until it tooks up to 2 hours to run tests (yes we have slow laptops I know, at least 4 times slower than the servers).</p>
<p>Actually we use phpunit for recipe test, including database change, third parties, providers&#8230; everything from A to Z&#8230; and that needs a lot of time and CPU power&#8230;</p>
<p>So we solved the problem by running test in a cronjob, hourly on the integration server.</p>
<p>This was done running phpunit in command line</p>
<p><code lang="bash"><br />
&gt; phpunit --include-path ../code/ MyTestSuite.php<br />
</code></p>
<p>Of course as we had several tests suites and we had to put them all in one bigger testsuite&#8230; but that was not easy so we moved to the Phpunit config file, added code coverage reporting and send a mail everytime sometimes goes wrong</p>
<p><strong>PhpunitConfig.xml</strong></p>
<p><code lang="xml"></p>
<pre class="brush: xml; title: ;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;phpunit
         colors=&quot;true&quot;
         &gt;
         &lt;testsuites&gt;
         	&lt;testsuite name=&quot;RTBF_Service&quot;&gt;
         		&lt;file&gt;RTBF/Service/Rating/Adapter/AbstractPhpunittest.php&lt;/file&gt;
         		&lt;file&gt;RTBF/Service/Rating/Adapter/MediaPhpunittest.php&lt;/file&gt;
         	&lt;--! ... --&gt;
         	&lt;/testsuite&gt;
         	&lt;testsuite name=&quot;RTBF&quot;&gt;
         		&lt;file&gt;RTBF/AclPhpunittest.php&lt;/file&gt;
         	&lt;/testsuite&gt;
         	&lt;testsuite name=&quot;RTBF_Utility&quot;&gt;
         		&lt;file&gt;RTBF/Utility/AjaxConnectorPhpunittest.php&lt;/file&gt;
	         	&lt;--! ... --&gt;
         	&lt;/testsuite&gt;
         	&lt;--! ... --&gt;
	&lt;/testsuites&gt;
	&lt;listeners&gt;
  		&lt;listener class=&quot;SimpleTestListener&quot; file=&quot;PhpunitTestListener.php&quot;&gt;
  		&lt;/listener&gt;
  	&lt;/listeners&gt;
  	&lt;!--
	&lt;logging&gt;
		&lt;log type=&quot;coverage-html&quot; target=&quot;/reporting/phpunit/library/&quot; charset=&quot;UTF-8&quot; /&gt;
	&lt;/logging&gt;
	--&gt;
	&lt;php&gt;
		&lt;ini name=&quot;memory_limit&quot; value=&quot;2047M&quot; /&gt;
	&lt;/php&gt;
	&lt;filter&gt;
	  &lt;blacklist&gt;
	    &lt;directory suffix=&quot;.php&quot;&gt;library/code/Zend&lt;/directory&gt;
	  &lt;/blacklist&gt;
	&lt;/filter&gt;
&lt;/phpunit&gt;
</pre>
<p></code></p>
<p><strong>PhpunitTestListener.php</strong></p>
<p><code lang="php"></p>
<pre class="brush: php; title: ;">
class SimpleTestListener implements PHPUnit_Framework_TestListener
{
	private $emailContent=array(self::Error=&gt;&quot;&quot;,self::Failure=&gt;&quot;&quot;,self::Incomplete=&gt;&quot;&quot;,self::Skipped=&gt;&quot;&quot;);
	private $assertions=0;
	private $itemCount=array(self::Error=&gt;0,self::Failure=&gt;0,self::Incomplete=&gt;0,self::Skipped=&gt;0);
	private $totalItems=0;

	const Error=&quot;Error&quot;;
	const Failure=&quot;Failure&quot;;
	const Incomplete=&quot;Incomplete&quot;;
	const Skipped=&quot;Skipped&quot;;

	private function addEmailContent($severity,$test,$e){
		$result = $test-&gt;getResult();
		$traces = $e-&gt;getTrace();
		$continue=true;
		$tracingMessage=&quot;&quot;;
		for($i=1;$i&lt;count($traces)&amp;&amp;$continue;$i++){
			if(isset($traces[$i]['file'])){
				$tracingMessage.=$traces[$i]['file'].&quot;:(&quot;.$traces[$i]['line'].&quot;)\n\t&quot;;
			}else{
				$continue=false;
			}
		}
		$this-&gt;itemCount[$severity]++;
		$this-&gt;emailContent[$severity].=$this-&gt;itemCount[$severity].&quot;)\t&quot;.get_class($test).'::'.$test-&gt;getName(TRUE).&quot;\n\t&quot;.str_replace(&quot;\n&quot;,&quot;\n\t&quot;,PHPUnit_Framework_TestFailure::exceptionToString($e)).&quot;&quot;.$tracingMessage.&quot;\n\n&quot;;
		$this-&gt;totalItems++;
	}

	public function addError(PHPUnit_Framework_Test $test,Exception $e,$time){
		$this-&gt;addEmailContent(self::Error,$test,$e);
	}

	public function addFailure(PHPUnit_Framework_Test $test,PHPUnit_Framework_AssertionFailedError $e,$time){
		$this-&gt;addEmailContent(self::Failure,$test,$e);
	}

	public function addIncompleteTest(PHPUnit_Framework_Test $test,Exception $e,$time){
		$this-&gt;addEmailContent(self::Incomplete,$test,$e);
	}

	public function addSkippedTest(PHPUnit_Framework_Test $test,Exception $e,$time){
		$this-&gt;addEmailContent(self::Skipped,$test,$e);
	}

	public function startTest(PHPUnit_Framework_Test $test){
	}

	public function endTest(PHPUnit_Framework_Test $test, $time){
	}

	public function startTestSuite(PHPUnit_Framework_TestSuite $suite){
	}

	public function endTestSuite(PHPUnit_Framework_TestSuite $suite){
	}

	public function __destruct(){
		if($this-&gt;totalItems&gt;0){
			// HIDDEN but concat everything from $this-&gt;emailContent nicely and send the mail
			//print(&quot;\n\nMail sent: &quot;.$text.&quot;\n&quot;);
		}
	}
}
</pre>
<p></code></p>
<p>That&#8217;s it for the big picture&#8230;</p>
<p>And as you can see there are several point in the XML that are quite important:</p>
<p><strong>memory limit 2047MB</strong>that&#8217;s huge&#8230; but this is the price to pay to have a fully working code-coverage HTML report. As we are using <a href="http://www.hardened-php.net/suhosin/">suhosin</a> we had to change the memory limit in suhosin too&#8230; and yes when the limit is 2048 MB don&#8217;t try to set the memory to 2048 MB it really means this is a limit you have to be under that limit (here 2047 MB).</p>
<p><strong>2 Gigs!!!</strong> I know this is huge but believe me I went through several tries and 128 MB was not enought, nor 256 MB, nor 512 MB, not even 1 GB &#8230; I didn&#8217;t try to see where is my limit &#8230; I put 2 gigs and then it worked&#8230; we have about 30% of lines covered so I think that if we shift to 100% we will have to give more memory&#8230; I&#8217;m pretty sure, there is something leaking somewhere&#8230; but according to phpunit.de site&#8230; I have the answer remains: <a href="https://github.com/sebastianbergmann/php-code-coverage/issues/closed/#issue/26">Give more memory</a></p>
<p><strong>/etc/php5/conf.d/suhosin.ini</strong><br />
<code></p>
<p>...<br />
suhosin.memory_limit = 2048M<br />
...</p>
<p></code></p>
<p><strong>logging</strong> is commented out because logging needs xdebug and while we stay with ZendServer CE we do not have xdebug&#8230; (see my previous post for more info). </p>
<p>But the server which is not running Zend Server CE does!</p>
<p>So I commented out the line in the config to let developers run the unit test and pasted it as command line argument on the server&#8217;s cronjob.</p>
<p><code lang="bash"></p>
<pre class="brush: bash; title: ;">
phpunit --include-path ../code/ --coverage-html /reporting/phpunit/library/ --configuration PhpunitConfig.xml
</pre>
<p></code></p>
<p><strong>the listener</strong> This is a simple easy listener. It&#8217;s always useful to have one sample so I pasted here above, feel free to copy, enhance&#8230; The only &#8216;hack&#8217; we use it to call the send email on listener destruction, so the email will be sent at the end. But there is a drawback&#8230; if there is a php error somewhere, nothing is sent. And as nothing is sent when everythign goes well&#8230; we dont know if everythings goes well or if there is a real bug&#8230;<br />
This problem will be addressed later. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2010/11/30/continuous-integration-phpunit-code-coverage-use-a-bit-less-than-2-gigs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>installing xdebug on ubuntu with Zend Server CE (not solved yet)</title>
		<link>http://blog.sbw.be/2010/11/12/installing-xdebug-on-ubuntu/</link>
		<comments>http://blog.sbw.be/2010/11/12/installing-xdebug-on-ubuntu/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 10:16:09 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[freelance]]></category>
		<category><![CDATA[truc de g33k]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[xdebug]]></category>
		<category><![CDATA[zend server ce]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=439</guid>
		<description><![CDATA[You need to sudo user@laptop:~$ sudo bash 1st be sre to have the pecl, pear available as root in command line root@laptop:~# PATH=$PATH:/usr/local/zend/bin trying to install root@laptop:~# pecl install xdebug downloading xdebug-2.1.0.tgz ... Starting to download xdebug-2.1.0.tgz (301,354 bytes) .....................................................done: 301,354 bytes 66 source files, building running: phpize Configuring for: PHP Api Version: 20041225 Zend [...]]]></description>
			<content:encoded><![CDATA[<p>You need to sudo</p>
<p><code>user@laptop:~$ sudo bash</code></p>
<p>1st be sre to have the pecl,  pear available as root in command line</p>
<p><code>root@laptop:~# PATH=$PATH:/usr/local/zend/bin</code></p>
<p>trying to install</p>
<p><code>root@laptop:~# pecl install xdebug<br />
downloading xdebug-2.1.0.tgz ...<br />
Starting to download xdebug-2.1.0.tgz (301,354 bytes)<br />
.....................................................done: 301,354 bytes<br />
66 source files, building<br />
running: phpize<br />
Configuring for:<br />
PHP Api Version:         20041225<br />
Zend Module Api No:      20060613<br />
Zend Extension Api No:   220060519<br />
Cannot find autoconf. Please check your autoconf installation and the<br />
$PHP_AUTOCONF environment variable. Then, rerun this script.</p>
<p>ERROR: `phpize' failed<br />
</code><br />
Argl it seems to be failing&#8230;</p>
<p>looks like autoconf is missing</p>
<p><code>root@laptop:~# autoconf<br />
The program 'autoconf' can be found in the following packages:<br />
 * autoconf<br />
 * autoconf2.13<br />
Try: apt-get install &lt;selected package&gt;<br />
</code></p>
<p>ok let&#8217;s add it:</p>
<p><code><br />
root@laptop:~# apt-get install autoconf<br />
</code></p>
<p>and now let&#8217;s try again</p>
<p><code><br />
root@laptop:~# pecl install xdebug<br />
downloading xdebug-2.1.0.tgz ...<br />
Starting to download xdebug-2.1.0.tgz (301,354 bytes)<br />
.............................................................done: 301,354 bytes<br />
66 source files, building<br />
running: phpize<br />
Configuring for:<br />
PHP Api Version:         20041225<br />
Zend Module Api No:      20060613<br />
Zend Extension Api No:   220060519<br />
configure.in:3: warning: prefer named diversions<br />
configure.in:3: warning: prefer named diversions<br />
building in /var/tmp/pear-build-root/xdebug-2.1.0<br />
running: /tmp/pear/temp/xdebug/configure<br />
checking for grep that handles long lines and -e... /bin/grep<br />
checking for egrep... /bin/grep -E<br />
checking for a sed that does not truncate output... /bin/sed<br />
checking for cc... cc<br />
...<br />
Build process completed successfully<br />
Installing '/usr/local/zend/lib/php_extensions/xdebug.so'<br />
install ok: channel://pecl.php.net/xdebug-2.1.0<br />
configuration option "php_ini" is not set to php.ini location<br />
You should add "extension=xdebug.so" to php.ini<br />
</code></p>
<p>Great!</p>
<p>Don&#8217;t forget to add the librairy in the php.ini</p>
<p>create the xdebug.ini in the ext.d directory and the symlink in the conf.d directory</p>
<p><code><br />
root@laptop:/usr/local/zend/etc/ext.d# more xdebug.ini<br />
zend_extension=/usr/local/zend/lib/php_extensions/xdebug.so<br />
; You may put any extension-specific directives here</p>
<p>root@laptop:/usr/local/zend/etc/conf.d# ln -s ../ext.d/xdebug.ini xdebug.ini<br />
</code></p>
<p>Now let&#8217;s try PHP:</p>
<p><code>scips@laptop:~$ php<br />
Segmentation fault<br />
</code></p>
<p>Looks like I need to investigate deeper&#8230;</p>
<p>Ok problem solved:</p>
<blockquote><p><strong>Instructions</strong></p>
<p><em><strong>Warning: You seem to be using Zend Server, which is known to cause issues with Xdebug. It might work, but you&#8217;re on your own.</strong></em></p>
<p>Download xdebug-2.1.0.tgz<br />
Unpack the downloaded file with tar -xvzf xdebug-2.1.0.tgz<br />
Run: cd xdebug-2.1.0<br />
Run: phpize</p>
<p>As part of its output it should show:</p>
<p>Configuring for:<br />
&#8230;<br />
Zend Module Api No:      20060613<br />
Zend Extension Api No:   220060519<br />
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.</p>
<p>Run: ./configure<br />
Run: make<br />
Run: cp modules/xdebug.so /usr/local/zend/lib/php_extensions<br />
Open /usr/local/zend/etc/conf.d/debugger.ini and put a ; in front of the line that says zend_extension_manager.dir.debugger= so that it says ;zend_extension_manager.dir.debugger=<br />
Edit /usr/local/zend/etc/php.ini and add at the begining of the file the line<br />
zend_extension = /usr/local/zend/lib/php_extensions/xdebug.so
</p></blockquote>
<p>I did just paste in has requested my php -i output on <a href="http://xdebug.org/find-binary.php">http://xdebug.org/find-binary.php</a> then compiled and everything ran fine.</p>
<p>The problem is that you have to use one or the other not the both at the same time&#8230; still not a real option for me. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2010/11/12/installing-xdebug-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Server CE &#124; PDO &#124; ubuntu 9.10 &#124; /tmp/mysql.sock</title>
		<link>http://blog.sbw.be/2009/12/11/zend-ce-pdo-ubuntu-mysql/</link>
		<comments>http://blog.sbw.be/2009/12/11/zend-ce-pdo-ubuntu-mysql/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 14:56:50 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[ce]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=339</guid>
		<description><![CDATA[You are using PDO and Zend Server CE and Ubuntu 9.10 You have a little problem? This is The solution (thanks to @DwebConsulting). sudo service mysql stop sudo cp /etc/mysql/my.cnf /etc/mysql/my.cnf.bak sudo cp /etc/mysql/debian.cnf /etc/mysql/debian.cnf.bak sudo vim /etc/mysql/my.cnf replace every line starting with &#8220;socket =&#8221; by &#8220;socket = /tmp/mysql.sock&#8221; sudo vim /etc/mysql/debian.cnf replace every line [...]]]></description>
			<content:encoded><![CDATA[<p>You are using PDO and Zend Server CE and Ubuntu 9.10</p>
<p>You have a little problem?</p>
<p>This is The solution (thanks to <a href="http://twitter.com/DwebConsulting">@DwebConsulting</a>).</p>
<ol>
<li>sudo service mysql stop</li>
<li>sudo cp /etc/mysql/my.cnf /etc/mysql/my.cnf.bak</li>
<li>sudo cp /etc/mysql/debian.cnf /etc/mysql/debian.cnf.bak</li>
<li>sudo vim /etc/mysql/my.cnf
<ol>
<li>replace every line starting with &#8220;socket =&#8221; by &#8220;socket = /tmp/mysql.sock&#8221; </li>
</ol>
</li>
<li>sudo vim /etc/mysql/debian.cnf
<ol>
<li>replace every line starting with &#8220;socket =&#8221; by &#8220;socket = /tmp/mysql.sock&#8221; </li>
</ol>
</li>
<li>sudo service mysql start</li>
</ol>
<p>in the Zend Server CE admin (http://localhost:10081/ZendServer/) > Server Setup > Directives ><br />
Search for default_socket and in mysql and mysqli remove the content of the textarea (empty value => default value used instead)<br />
Then click <strong>Save Changes</strong> and click <strong>Restart PHP</strong></p>
<p>It will work until Zend Server CE bug is fixed (release 5.0).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2009/12/11/zend-ce-pdo-ubuntu-mysql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Firefox Ubiquity php search handy command</title>
		<link>http://blog.sbw.be/2009/08/26/firefox-ubiquity-php-search-handy-command/</link>
		<comments>http://blog.sbw.be/2009/08/26/firefox-ubiquity-php-search-handy-command/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 14:22:35 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[freelance]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[truc de g33k]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=301</guid>
		<description><![CDATA[Just created a Firfow Ubiquity php search command based on 2 other work: http://download.sbw.be/projects/ubiquity/php-search.html]]></description>
			<content:encoded><![CDATA[<p>Just created a Firfow Ubiquity php search command based on 2 other work: <a href="http://download.sbw.be/projects/ubiquity/php-search.html">http://download.sbw.be/projects/ubiquity/php-search.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2009/08/26/firefox-ubiquity-php-search-handy-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP test &#8211; #1</title>
		<link>http://blog.sbw.be/2009/04/08/php-test-1/</link>
		<comments>http://blog.sbw.be/2009/04/08/php-test-1/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 22:13:05 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[Questions existentielles]]></category>
		<category><![CDATA[truc de g33k]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/2009/04/08/php-test-1/</guid>
		<description><![CDATA[What happens with the following code: &#60;?php for($i=a;$i&#38;lt;=z;$i++) echo(&#34;$i\n&#34;); ?&#62; And what&#8217;s the difference with? &#60;?php for($i=a;$i&#38;lt;z;$i++) echo(&#34;$i\n&#34;); ?&#62; Why is the result different? and How? &#8230; Worst: &#60;?php $i=a; while(strcmp($i,z)&#60;=0){ echo($i.&#34;\n&#34;); $i++; } ?&#62; Gives exactly the same result as the second exemple. &#8230; hints: http://www.php.net/manual/en/language.types.string.php#language.types.string.conversion http://www.php.net/manual/en/language.operators.comparison.php http://www.php.net/manual/en/language.types.string.php]]></description>
			<content:encoded><![CDATA[<p>What happens with the following code:</p>
<pre class="brush: php; title: ;">
&lt;?php
for($i=a;$i&amp;lt;=z;$i++) echo(&quot;$i\n&quot;);
?&gt;
</pre>
<p>And what&#8217;s the difference with?</p>
<pre class="brush: php; title: ;">
&lt;?php
for($i=a;$i&amp;lt;z;$i++) echo(&quot;$i\n&quot;);
?&gt;
</pre>
<p>Why is the result different? and How?<br />
&#8230;<br />
Worst:</p>
<pre class="brush: php; title: ;">
&lt;?php
$i=a;
while(strcmp($i,z)&lt;=0){
   echo($i.&quot;\n&quot;);
   $i++;
}
?&gt;
</pre>
<p>Gives exactly the same result as the second exemple.<br />
&#8230;</p>
<p>hints:<br />
<a href="http://www.php.net/manual/en/language.types.string.php#language.types.string.conversion">http://www.php.net/manual/en/language.types.string.php#language.types.string.conversion</a><br />
<a href="http://www.php.net/manual/en/language.operators.comparison.php">http://www.php.net/manual/en/language.operators.comparison.php</a><br />
<a href="http://www.php.net/manual/en/language.types.string.php">http://www.php.net/manual/en/language.types.string.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2009/04/08/php-test-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Coding Dojo</title>
		<link>http://blog.sbw.be/2009/04/05/coding-dojo/</link>
		<comments>http://blog.sbw.be/2009/04/05/coding-dojo/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 08:03:16 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[truc de g33k]]></category>
		<category><![CDATA[Dojo]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/2009/04/05/coding-dojo/</guid>
		<description><![CDATA[@ São Paulo University http://www.dtsato.com/blog/wp-content/uploads/2008/06/sato-codingdojo.pdf Session process: Problem choosing (5 min) Problem discussion (10 min) Coding session (1h) Retrospective (10 min) 2 Style of coding sessions: Randori dojo Prepared Kata Session roles: Moderator: Moderating the discussion, conducting the retrospective Organizer: Room Reservation, setting up computer, projector, sending reminder, preparing the program, cleaning the room Scribe: [...]]]></description>
			<content:encoded><![CDATA[<p>@ São Paulo University <a href="http://www.dtsato.com/blog/wp-content/uploads/2008/06/sato-codingdojo.pdf">http://www.dtsato.com/blog/wp-content/uploads/2008/06/sato-codingdojo.pdf</a> </p>
<p>Session process:</p>
<ol>
<li>Problem choosing (5 min)</li>
<li>Problem discussion (10 min)</li>
<li>Coding session (1h)</li>
<li>Retrospective (10 min)</li>
</ol>
<p>2 Style of coding sessions:</p>
<ul>
<li>Randori dojo</li>
<li>Prepared Kata</li>
</ul>
<p>Session roles:</p>
<ul>
<li>Moderator: Moderating the discussion, conducting the retrospective</li>
<li>Organizer: Room Reservation, setting up computer, projector, sending reminder, preparing the program, cleaning the room</li>
<li>Scribe: Publishing and sharing the result of the meeting, taking photo, video&#8230;</li>
<li>Participants: Maximum 16 (including Moderator/Organize/Scribe)</li>
</ul>
<p>Principles:</p>
<ul>
<li>TDD</li>
<li>Time Boxing (strictly 7 min / programming pair)</li>
<li>Time Boxed Discussion Break</li>
<li>Silence during Randori</li>
<li>Everyone must be in a programming pair</li>
<li>Use only the software hardware prepared fot the session</li>
</ul>
<p>See also: <a href="http://www.codingdojo.org">www.codingdojo.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2009/04/05/coding-dojo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

