<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://prendreuncafe.com/blog/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>Prendre un Café - Tag - pecl</title>
  <link>http://prendreuncafe.com/blog/</link>
  <atom:link href="http://prendreuncafe.com/blog/feed/tag/pecl/rss2" rel="self" type="application/rss+xml"/>
  <description></description>
  <language>fr</language>
  <pubDate>Thu, 11 Mar 2010 18:08:52 +0100</pubDate>
  <copyright>Contenus sous licence Creative Commons BY-SA</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Utiliser les fonctions GeoIP de PHP sous Ubuntu</title>
    <link>http://prendreuncafe.com/blog/post/2009/06/02/Utiliser-les-fonctions-GeoIP-de-PHP-sous-Ubuntu</link>
    <guid isPermaLink="false">urn:md5:96aae74d1d8d1a45023dce91001dfb01</guid>
    <pubDate>Tue, 02 Jun 2009 08:00:00 +0200</pubDate>
    <dc:creator>NiKo</dc:creator>
        <category>Dev</category>
        <category>geo</category><category>geoip</category><category>linux</category><category>pecl</category><category>php</category><category>ubuntu</category>    
    <description>    &lt;p&gt;Mon Dieu, les billets techniques refleuriraient-ils au &lt;a href=&quot;http://www.flickr.com/photos/n1k0/3558287917/&quot;&gt;printemps&lt;/a&gt;&amp;#160;? Si vous désirez récupérer des informations géographiques à partir de l&amp;#8217;adresse IP (ou du hostname) d&amp;#8217;un utilisateur, vous pouvez utiliser les fonctions fournies par &lt;a href=&quot;http://pecl.php.net/package/geoip&quot; hreflang=&quot;en&quot;&gt;l&amp;#8217;extension PECL GeoIP&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Voici la procédure d&amp;#8217;installation sur une &lt;a href=&quot;http://ubuntu-fr.org/&quot; hreflang=&quot;fr&quot;&gt;Ubuntu&lt;/a&gt; 8.04:&lt;/p&gt;


&lt;pre&gt;$ sudo -s
# apt-get install build-essential php5-dev php5-cli libgeoip-dev libgeoip1 php-pear
# pecl install geoip&lt;/pre&gt;


&lt;p&gt;Si toiut s&amp;#8217;est bien passé&amp;#160;:&lt;/p&gt;


&lt;pre&gt;# echo &amp;quot;extension=geoip.so&amp;quot; &amp;gt;&amp;gt; /etc/php5/cli/php.ini&lt;/pre&gt;


&lt;p&gt;Si vous utilisez Apache comme serveur&amp;#160;:&lt;/p&gt;


&lt;pre&gt;# echo &amp;quot;extension=geoip.so&amp;quot; &amp;gt;&amp;gt; /etc/php5/apache2/php.ini&lt;/pre&gt;


&lt;p&gt;Il faut également installer la base GeoIPCity de &lt;a href=&quot;http://www.maxmind.com/app/ip-location&quot; hreflang=&quot;en&quot;&gt;Maxmind&lt;/a&gt;&amp;#160;:&lt;/p&gt;


&lt;pre&gt;# wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
# gunzip GeoLiteCity.dat.gz
# mv GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat&lt;/pre&gt;


&lt;p&gt;Vous pouvez maintenant tester l&amp;#8217;extension avec une ligne du genre&lt;sup&gt;[&lt;a href=&quot;http://prendreuncafe.com/blog/post/2009/06/02/Utiliser-les-fonctions-GeoIP-de-PHP-sous-Ubuntu#pnote-1116-1&quot; id=&quot;rev-pnote-1116-1&quot;&gt;1&lt;/a&gt;]&lt;/sup&gt;&amp;#160;:&lt;/p&gt;


&lt;pre&gt;$ echo &amp;quot;&amp;lt;?php var_dump(geoip_record_by_name('209.202.168.**'));&amp;quot;|php&lt;/pre&gt;


&lt;p&gt;Ça donne ici&amp;#160;:&lt;/p&gt;

&lt;pre&gt;
array(11) {  [&amp;quot;continent_code&amp;quot;]=&amp;gt;
  string(2) &amp;quot;NA&amp;quot;
  [&amp;quot;country_code&amp;quot;]=&amp;gt;
  string(2) &amp;quot;US&amp;quot;
  [&amp;quot;country_code3&amp;quot;]=&amp;gt;
  string(3) &amp;quot;USA&amp;quot;
  [&amp;quot;country_name&amp;quot;]=&amp;gt;
  string(13) &amp;quot;United States&amp;quot;
  [&amp;quot;region&amp;quot;]=&amp;gt;
  string(2) &amp;quot;NC&amp;quot;
  [&amp;quot;city&amp;quot;]=&amp;gt;
  string(4) &amp;quot;Cary&amp;quot;
  [&amp;quot;postal_code&amp;quot;]=&amp;gt;
  string(5) &amp;quot;27511&amp;quot;
  [&amp;quot;latitude&amp;quot;]=&amp;gt;
  float(35.7********)
  [&amp;quot;longitude&amp;quot;]=&amp;gt;
  float(-78.7*******)
  [&amp;quot;dma_code&amp;quot;]=&amp;gt;
  int(560)
  [&amp;quot;area_code&amp;quot;]=&amp;gt;
  int(919)
}
&lt;/pre&gt;


&lt;p&gt;Enjoy.&lt;/p&gt;
&lt;div class=&quot;footnotes&quot;&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href=&quot;http://prendreuncafe.com/blog/post/2009/06/02/Utiliser-les-fonctions-GeoIP-de-PHP-sous-Ubuntu#rev-pnote-1116-1&quot; id=&quot;pnote-1116-1&quot;&gt;1&lt;/a&gt;] J&amp;#8217;ai volontairement masqué certaines informations pour d&amp;#8217;évidentes raisons de confidentialité.&lt;/p&gt;&lt;/div&gt;&lt;hr/&gt;&lt;p style=&quot;margin:.5em 0;padding:.5em;border:1px solid #333;background:#eee;color:#222&quot;&gt;&lt;small&gt;Ce billet intitulé &lt;a href=&quot;http://prendreuncafe.com/blog/post/2009/06/02/Utiliser-les-fonctions-GeoIP-de-PHP-sous-Ubuntu&quot;&gt;Utiliser les fonctions GeoIP de PHP sous Ubuntu&lt;/a&gt; a été rédigé par &lt;a href=&quot;http://prendreuncafe.com/cv&quot;&gt;Nicolas Perriault&lt;/a&gt; et publié sur le blog &lt;a href=&quot;http://prendreuncafe.com/blog/&quot;&gt;Prendre un Café&lt;/a&gt; sous licence &lt;a href=&quot;http://creativecommons.org/licenses/by-nc-sa/2.5/&quot;&gt;Creative Commons BY-NC-SA&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Installer XDebug sur Ubuntu et l'utiliser avec Symfony</title>
    <link>http://prendreuncafe.com/blog/post/2006/11/29/Installer-XDebug-sur-Ubuntu-et-lutiliser-avec-Symfony</link>
    <guid isPermaLink="false">urn:md5:14ef80c144b018d3a212830d8702fcde</guid>
    <pubDate>Wed, 29 Nov 2006 15:33:00 +0100</pubDate>
    <dc:creator>NiKo</dc:creator>
        <category>Dev</category>
        <category>bestpractices</category><category>bug</category><category>linux</category><category>pecl</category><category>php</category><category>symfony</category><category>tests</category><category>ubuntu</category><category>xdebug</category>    
    <description>    &lt;p&gt;Si comme moi vous développez beaucoup avec &lt;a href=&quot;http://www.symfony-project.com&quot; hreflang=&quot;en&quot;&gt;Symfony&lt;/a&gt; &lt;sup&gt;[&lt;a href=&quot;http://prendreuncafe.com/blog/post/2006/11/29/Installer-XDebug-sur-Ubuntu-et-lutiliser-avec-Symfony#pnote-835-1&quot; id=&quot;rev-pnote-835-1&quot;&gt;1&lt;/a&gt;]&lt;/sup&gt; (ou avec PHP en général), les informations fournies par &lt;a href=&quot;http://www.xdebug.org&quot; hreflang=&quot;en&quot;&gt;XDebug&lt;/a&gt; peuvent être très utiles. Pour installer &lt;em&gt;XDebug 2.0RC1&lt;/em&gt; sur une &lt;a href=&quot;http://doc.ubuntu-fr.org/versions/edgy_eft&quot; hreflang=&quot;fr&quot;&gt;Ubuntu Edgy&lt;/a&gt;, voici la démarche à suivre :&lt;/p&gt;


&lt;pre&gt;$ sudo apt-get install php-pear php5-dev
$ sudo pecl install xdebug-beta&lt;/pre&gt;


&lt;p&gt;C'est dur hein ? Bon, il reste une petite manipulation : il faut activer l'extension dans votre (ou vos) fichier(s) &lt;code&gt;php.ini&lt;/code&gt;. Par exemple chez moi, je rajoute cette ligne à la toute fin du fichier :&lt;/p&gt;


&lt;pre&gt;zend_extension=&amp;quot;/usr/lib/php5/20051025/xdebug.so&amp;quot;&lt;/pre&gt;


&lt;p&gt;Et je relance Apache. Pour ceux qui connaissent la barre de débug en ligne de Symfony, vous allez voir du changement (&lt;a href=&quot;http://prendreuncafe.com/blog/public/images/Dev/PHP/sf_avant_xdebug.png&quot;&gt;avant&lt;/a&gt; / &lt;a href=&quot;http://prendreuncafe.com/blog/public/images/Dev/PHP/sf_apres_xdebug.png&quot;&gt;après&lt;/a&gt;)&lt;/p&gt;


&lt;p&gt;Évidemment les perfs en prennent un coup, mais le jeu en vaut la chandelle quand on cherche le vilain dysfonctionnement volatile.&lt;/p&gt;


&lt;p&gt;Merci XDebug, merci Symfony !&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Edit :&lt;/strong&gt; Ajout du paquet &lt;code&gt;php_pear&lt;/code&gt; contenant &lt;code&gt;pecl&lt;/code&gt;, merci Mat.&lt;/p&gt;
&lt;div class=&quot;footnotes&quot;&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href=&quot;http://prendreuncafe.com/blog/post/2006/11/29/Installer-XDebug-sur-Ubuntu-et-lutiliser-avec-Symfony#rev-pnote-835-1&quot; id=&quot;pnote-835-1&quot;&gt;1&lt;/a&gt;] Qui vient tout juste de &lt;a href=&quot;http://www.symfony-project.com/weblog/2006/11/29/announcing-symfony-1-0-beta-1.html&quot; hreflang=&quot;en&quot;&gt;sortir en 1.0 beta 1&lt;/a&gt; !&lt;/p&gt;&lt;/div&gt;&lt;hr/&gt;&lt;p style=&quot;margin:.5em 0;padding:.5em;border:1px solid #333;background:#eee;color:#222&quot;&gt;&lt;small&gt;Ce billet intitulé &lt;a href=&quot;http://prendreuncafe.com/blog/post/2006/11/29/Installer-XDebug-sur-Ubuntu-et-lutiliser-avec-Symfony&quot;&gt;Installer XDebug sur Ubuntu et l'utiliser avec Symfony&lt;/a&gt; a été rédigé par &lt;a href=&quot;http://prendreuncafe.com/cv&quot;&gt;Nicolas Perriault&lt;/a&gt; et publié sur le blog &lt;a href=&quot;http://prendreuncafe.com/blog/&quot;&gt;Prendre un Café&lt;/a&gt; sous licence &lt;a href=&quot;http://creativecommons.org/licenses/by-nc-sa/2.5/&quot;&gt;Creative Commons BY-NC-SA&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Installer l'accélerateur APC pour PHP5 sur Ubuntu</title>
    <link>http://prendreuncafe.com/blog/post/2006/11/01/Installer-laccelerateur-APC-pour-PHP5-sur-Ubuntu</link>
    <guid isPermaLink="false">urn:md5:257bf2e7bf0abad5ed1834947abc7eaf</guid>
    <pubDate>Wed, 01 Nov 2006 11:00:00 +0100</pubDate>
    <dc:creator>NiKo</dc:creator>
        <category>Ubuntu</category>
        <category>apc</category><category>linux</category><category>optimisation</category><category>pecl</category><category>performance</category><category>php</category><category>serveur</category><category>ubuntu</category>    
    <description>    &lt;p&gt;&lt;a href=&quot;http://pecl.php.net/apc&quot; hreflang=&quot;en&quot;&gt;APC&lt;/a&gt; est un accélérateur PHP qui permet d'optimiser les performances de vos applications PHP. Voyons comment l'installer sur un serveur Ubuntu Dapper Drake 6.06 LTS avec Apache2 et PHP5 :&lt;/p&gt;


&lt;pre&gt;$ sudo apt-get update
$ sudo apt-get install build-essential php5-dev php-pear apache2-prefork-dev&lt;/pre&gt;


&lt;p&gt;On va utiliser l'utilitaire de gestion de modules d'Apache2, &lt;code&gt;apxs2&lt;/code&gt;. APC va chercher par défaut la version Apache1, donc on fait un lien symbolique :&lt;/p&gt;


&lt;pre&gt;$ sudo ln -s /usr/bin/apxs2 /usr/bin/apxs&lt;/pre&gt;


&lt;p&gt;Cette installation nécessite une importante quantité de mémoire vive allouée à PHP, aussi nous allons devoir augmenter cette valeur au sein du script de commande PEAR en modifiant le fichier &lt;code&gt;/usr/share/php/pearcmd.php&lt;/code&gt; et en y ajoutant en tête de fichier la ligne :&lt;/p&gt;


&lt;pre&gt;&amp;lt;?php
ini_set('memory_limit','24M');&lt;/pre&gt;


&lt;p&gt;Tout est prêt, on peut lancer l'installation d'APC via PECL :&lt;/p&gt;


&lt;pre&gt;$ sudo pecl install apc&lt;/pre&gt;


&lt;p&gt;Répondez oui à toutes les questions posées. Ceci fait et si l'installation s'est déroulée convenablement, éditez votre fichier &lt;code&gt;/etc/php5/apache2/php.ini&lt;/code&gt; :&lt;/p&gt;


&lt;pre&gt;extension=apc.so&lt;/pre&gt;


&lt;p&gt;Il ne reste plus qu'à redémarrer Apache2 pour profiter d'une substantielle amélioration des performances de vos applications PHP5 &lt;img src=&quot;/blog/themes/battlestar/smilies/smile.gif&quot; alt=&quot;:-)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;&lt;hr/&gt;&lt;p style=&quot;margin:.5em 0;padding:.5em;border:1px solid #333;background:#eee;color:#222&quot;&gt;&lt;small&gt;Ce billet intitulé &lt;a href=&quot;http://prendreuncafe.com/blog/post/2006/11/01/Installer-laccelerateur-APC-pour-PHP5-sur-Ubuntu&quot;&gt;Installer l'accélerateur APC pour PHP5 sur Ubuntu&lt;/a&gt; a été rédigé par &lt;a href=&quot;http://prendreuncafe.com/cv&quot;&gt;Nicolas Perriault&lt;/a&gt; et publié sur le blog &lt;a href=&quot;http://prendreuncafe.com/blog/&quot;&gt;Prendre un Café&lt;/a&gt; sous licence &lt;a href=&quot;http://creativecommons.org/licenses/by-nc-sa/2.5/&quot;&gt;Creative Commons BY-NC-SA&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;</description>
    
    
    
      </item>
    
</channel>
</rss>
