<?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>Not My Idea &#187; CGI</title>
	<atom:link href="http://www.notmyidea.org/article/tag/cgi/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.notmyidea.org</link>
	<description>Carnets Web d&#039;Alexis Métaireau</description>
	<lastBuildDate>Mon, 16 Aug 2010 19:09:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Installation de PHP 5.3 en tant que CGI</title>
		<link>http://www.notmyidea.org/article/installation-de-php-5-3-en-tant-que-cgi/</link>
		<comments>http://www.notmyidea.org/article/installation-de-php-5-3-en-tant-que-cgi/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 01:34:33 +0000</pubDate>
		<dc:creator>Alexis Metaireau</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[CGI]]></category>
		<category><![CDATA[php5.3]]></category>

		<guid isPermaLink="false">http://www.notmyidea.org/?p=120</guid>
		<description><![CDATA[PHP 5.3 est disponible depuis peu sur le site de php. J&#8217;ai sauté sur l&#8217;occasion pour le télécharger et l&#8217;installer sur ma machine de développement, pour pouvoir profiter des nombreuses et alléchantes nouvelles fonctionnalités offertes par cette version.
Ayant besoin de garder une version de PHP 5.2 disponible, j&#8217;ai choisi d&#8217;installer PHP 5.3 en tant que [...]]]></description>
			<content:encoded><![CDATA[<p>PHP 5.3 est disponible depuis peu sur le site de php. J&#8217;ai sauté sur l&#8217;occasion pour le télécharger et l&#8217;installer sur ma machine de développement, pour pouvoir profiter des nombreuses et alléchantes nouvelles fonctionnalités offertes par cette version.</p>
<p>Ayant besoin de garder une version de PHP 5.2 disponible, j&#8217;ai choisi d&#8217;installer PHP 5.3 en tant que CGI pour Apache. Rien de très compliqué, mais si je peux vous éviter de tourner en rond, voila comment j&#8217;ai procédé sur un système à base de debian (ubuntu ici).<br />
<span id="more-120"></span></p>
<p>D&#8217;abord, pour les pressés (enfin, il vous faudra quand même un petit café le temps de la compilation), vous pouvez directement copier/coller cette ligne dans une console (en mode su<sup>1</sup>):</p>
<div class="codecolorer-container bash notmyidea" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libxml2-dev <span style="color: #660033;">-y</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>fr2.php.net<span style="color: #000000; font-weight: bold;">/</span>get<span style="color: #000000; font-weight: bold;">/</span>php-5.3.0.tar.gz<span style="color: #000000; font-weight: bold;">/</span>from<span style="color: #000000; font-weight: bold;">/</span>fr.php.net<span style="color: #000000; font-weight: bold;">/</span>mirror <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvf</span> php-5.3.0.tar.gz <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> php-5.3.0 <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> a2enmod actions <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'ScriptAlias /cgi-bin/ /usr/local/bin/'</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>apache2.conf <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> apache2ctl restart <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">exit</span></div></div>
<p>Le détail est par ici:</p>
<p>On commence par installer les bibliothèques dépendantes:</p>
<div class="codecolorer-container bash notmyidea" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libxml2-dev <span style="color: #660033;">-y</span></div></div>
<p>On télécharge la dernière archive surphp.net:</p>
<div class="codecolorer-container bash notmyidea" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>fr2.php.net<span style="color: #000000; font-weight: bold;">/</span>get<span style="color: #000000; font-weight: bold;">/</span>php-5.3.0.tar.gz<span style="color: #000000; font-weight: bold;">/</span>from<span style="color: #000000; font-weight: bold;">/</span>fr.php.net<span style="color: #000000; font-weight: bold;">/</span>mirror</div></div>
<p>On l&#8217;extrait:</p>
<div class="codecolorer-container bash notmyidea" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvf</span> php-5.3.0.tar.gz</div></div>
<p>On compile ..</p>
<div class="codecolorer-container bash notmyidea" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> php-5.3.0<br />
.<span style="color: #000000; font-weight: bold;">/</span>configure<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>C&#8217;est quasiment prêt, les fichiers binaires ont étés crées dans /usr/local/bin/ , il ne reste plus qu&#8217;à activer le module actions pour apache (pour pouvoir utiliser les CGIs):</p>
<div class="codecolorer-container bash notmyidea" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod actions</div></div>
<p>et à spécifier l&#8217;emplacement de nos cgis à Apache:</p>
<div class="codecolorer-container bash notmyidea" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'ScriptAlias /cgi-bin/ /usr/local/bin/'</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>apache2.conf</div></div>
<p>Voila, il ne vous reste plus qu&#8217;à relancer apache à coup de</p>
<div class="codecolorer-container text notmyidea" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">apachectl restart</div></div>
<p>et c&#8217;est parti !</p>
<p>Maintenant, pour utiliser PHP 5.3 au lieu de la version installée par défaut, il vous faudra créer un htaccess avec le contenu suivant (vous pouvez passer aussi directement par le vhost ):</p>
<div class="codecolorer-container bash notmyidea" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">AddHandler x-httpd-php5 .php<br />
Action x-httpd-php5 <span style="color: #000000; font-weight: bold;">/</span>cgi-bin<span style="color: #000000; font-weight: bold;">/</span>php-cgi</div></div>
<p>A nous les joies de php 5.3 !<br />
<img class="aligncenter size-full wp-image-127" title="php-53" src="http://www.notmyidea.org/wp-content/uploads/2009/03/php-53.png" alt="php-53" width="400" height="378" /></p>
<ol class="footnotes"><li id="footnote_0_120" class="footnote">sudo su</li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.notmyidea.org/article/installation-de-php-5-3-en-tant-que-cgi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
