<?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>MacFan &#187; Php</title>
	<atom:link href="http://www.jkraft.fr/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jkraft.fr</link>
	<description>Tout sur le web et le développement</description>
	<lastBuildDate>Mon, 23 Jan 2012 09:07:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>[Php] Pourquoi je déteste Drupal</title>
		<link>http://www.jkraft.fr/2011/10/14/pourquoi-je-deteste-drupal/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pourquoi-je-deteste-drupal</link>
		<comments>http://www.jkraft.fr/2011/10/14/pourquoi-je-deteste-drupal/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 08:14:08 +0000</pubDate>
		<dc:creator>kraft</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Développement]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://www.jkraft.fr/?p=699</guid>
		<description><![CDATA[Je suis tombé par hasard sur ce site et j’adhère complètement : http://www.freeblogware.org/2010/06/pourquoi-je-deteste-drupal-et-la.html Drupal est une horreur, depuis peu je suis amené à mettre le nez dedans et je déchante complètement. Pas de POO, pas de MVC, tout en base de données.. Pour développer une simple fonction il faut toucher au Php et à la [...]]]></description>
			<content:encoded><![CDATA[<p>Je suis tombé par hasard sur ce site et j’adhère complètement :<br />
<a href="http://www.freeblogware.org/2010/06/pourquoi-je-deteste-drupal-et-la.html" target="_blank">http://www.freeblogware.org/2010/06/pourquoi-je-deteste-drupal-et-la.html</a></p>
<p>Drupal est une horreur, depuis peu je suis amené à mettre le nez dedans et je déchante complètement. Pas de POO, pas de MVC, tout en base de données..<br />
Pour développer une simple fonction il faut toucher au Php et à la base de données.</p>
<p>En résumé, je n&#8217;aime pas!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jkraft.fr/2011/10/14/pourquoi-je-deteste-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PHP] Retourner un tableau avec NuSoap</title>
		<link>http://www.jkraft.fr/2010/11/05/php-retourner-un-tableau-avec-nusoap/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=php-retourner-un-tableau-avec-nusoap</link>
		<comments>http://www.jkraft.fr/2010/11/05/php-retourner-un-tableau-avec-nusoap/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 13:55:17 +0000</pubDate>
		<dc:creator>kraft</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[webservice]]></category>
		<category><![CDATA[webservices]]></category>

		<guid isPermaLink="false">http://www.jkraft.fr/?p=623</guid>
		<description><![CDATA[Voilà une question qu&#8217;on me pose souvent, comment renvoyer un tableau à travers un WebService avec NuSoap. Donc voilà une petite explication. Comme pour tous les WS avec NuSoap, il faut définir l&#8217;objet renvoyer. Par exemple ici, on va définir un contact comprenant un nom, prenom, site web et un téléphone. Puis on va définir [...]]]></description>
			<content:encoded><![CDATA[<p>Voilà une question qu&#8217;on me pose souvent, comment renvoyer un tableau à travers un WebService avec NuSoap.<br />
Donc voilà une petite explication.<br />
<span id="more-623"></span></p>
<p>Comme pour tous les WS avec NuSoap, il faut définir l&#8217;objet renvoyer.<br />
Par exemple ici, on va définir un <em>contact</em> comprenant un nom, prenom, site web et un téléphone. Puis on va définir un tableau de contact, le <em>ContactArray</em></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$serveur</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">wsdl</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addComplexType</span><span style="color: #009900;">&#40;</span>
   <span style="color: #0000ff;">'Contact'</span><span style="color: #339933;">,</span>
   <span style="color: #0000ff;">'complexType'</span><span style="color: #339933;">,</span>
   <span style="color: #0000ff;">'struct'</span><span style="color: #339933;">,</span>
   <span style="color: #0000ff;">'all'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
   <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
      <span style="color: #0000ff;">'nom'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'nom'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'xsd:string'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'prenom'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'prenom'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'xsd:string'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'web'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'web'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'xsd:string'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'tel'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'tel'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'xsd:int'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
   <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$serveur</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">wsdl</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addComplexType</span><span style="color: #009900;">&#40;</span>
   <span style="color: #0000ff;">'ContactArray'</span><span style="color: #339933;">,</span>
   <span style="color: #0000ff;">'complexType'</span><span style="color: #339933;">,</span>
   <span style="color: #0000ff;">'array'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
   <span style="color: #0000ff;">'SOAP-ENC:Array'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
   <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
      <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ref'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'SOAP-ENC:arrayType'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'wsdl:arrayType'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'tns:Contact[]'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
   <span style="color: #0000ff;">'tns:Contact'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Puis comme d habitude on définit la méthode du WS.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$serveur</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">register</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'getContacts'</span><span style="color: #339933;">,</span>
                           <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">//pas de paramètre en entré</span>
                           <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Contact'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'tns:ContactArray'</span><span style="color: #009900;">&#41;</span>
               <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Donc getContacts retournera un ContactArray. Il ne reste plus qu&#8217;à définir getContacts.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> getContacts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$req</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;SELECT * FROM `Contacts`&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$res</span><span style="color: #339933;">=</span><span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$req</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$obj</span><span style="color: #339933;">=</span><span style="color: #990000;">mysql_fetch_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'nom'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$obj</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nom</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'prenom'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$obj</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">prenom</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'email'</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$obj</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">email</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tel'</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$obj</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tel</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$result</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Et voilà!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jkraft.fr/2010/11/05/php-retourner-un-tableau-avec-nusoap/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Astuce TextMate</title>
		<link>http://www.jkraft.fr/2010/10/24/astuce-textmate/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=astuce-textmate</link>
		<comments>http://www.jkraft.fr/2010/10/24/astuce-textmate/#comments</comments>
		<pubDate>Sun, 24 Oct 2010 22:49:17 +0000</pubDate>
		<dc:creator>kraft</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[astuce]]></category>
		<category><![CDATA[ide]]></category>

		<guid isPermaLink="false">http://www.jkraft.fr/?p=606</guid>
		<description><![CDATA[Pour ceux qui utilise TextMate pour développer, il y a une option qui me manquait cruellement. Celle de pouvoir aller directement à la définition d&#8217;une méthode ou d&#8217;une classe. Et bien il suffit d&#8217;utiliser ce bout de code dans un bundle : 1 2 3 4 5 6 7 8 9 10 11 12 13 [...]]]></description>
			<content:encoded><![CDATA[<p>Pour ceux qui utilise TextMate pour développer, il y a une option qui me manquait cruellement. Celle de pouvoir aller directement à la définition d&#8217;une méthode ou d&#8217;une classe.<br />
<span id="more-606"></span><br />
Et bien il suffit d&#8217;utiliser ce bout de code dans un bundle :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">FUNC</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$TM_CURRENT_WORD</span>&quot;</span>
<span style="color: #007800;">DIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$TM_PROJECT_DIRECTORY</span>&quot;</span>
<span style="color: #007800;">OUTPUT</span>=<span style="color: #ff0000;">''</span>
&nbsp;
<span style="color: #007800;">FILES</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DIR</span>&quot;</span> <span style="color: #660033;">-type</span> f <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">egrep</span> <span style="color: #ff0000;">'\.(module|inc|php|engine|install)$'</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Look for a function declaration within a files contents.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># &lt;file&gt; &lt;function&gt;</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #000000; font-weight: bold;">function</span> lookup_function <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #7a0874; font-weight: bold;">local</span> <span style="color: #007800;">line</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">nl</span> <span style="color: #660033;">-b</span> a <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'function '</span><span style="color: #ff0000;">&quot;$2&quot;</span><span style="color: #ff0000;">'('</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #000000; font-weight: bold;">`</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$line</span>&quot;</span> <span style="color: #660033;">-gt</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    mate <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #660033;">-l</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$line</span>&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Iterate files</span>
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #007800;">i</span>=<span style="color: #000000;">0</span>; i <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #800000;">${#FILES[*]}</span>; i++<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #007800;">file</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${FILES[${i}</span>]}&quot;</span>
  lookup_function <span style="color: #ff0000;">&quot;<span style="color: #007800;">$file</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FUNC</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Nothing found</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'Function '</span><span style="color: #800000;">${FUNC}</span><span style="color: #ff0000;">' was not found within the current project.'</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.jkraft.fr/2010/10/24/astuce-textmate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PHP] Serveur de WebServices SOAP</title>
		<link>http://www.jkraft.fr/2010/07/19/serveur-webservice-soap/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=serveur-webservice-soap</link>
		<comments>http://www.jkraft.fr/2010/07/19/serveur-webservice-soap/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 10:41:01 +0000</pubDate>
		<dc:creator>kraft</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[Iphone]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[nusoap]]></category>
		<category><![CDATA[Serveur]]></category>
		<category><![CDATA[webservices]]></category>

		<guid isPermaLink="false">http://www.jkraft.fr/?p=549</guid>
		<description><![CDATA[A la demande général, je met le code de mon serveur de WebServices SOAP qui sert dans mon tutorial pour l&#8217;iPhone. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 [...]]]></description>
			<content:encoded><![CDATA[<p>A la demande général, je met le code de mon serveur de WebServices SOAP qui sert dans mon <a target="blank" href="http://www.jkraft.fr/2009/07/19/objective-c-iphone-et-webservices-soap/">tutorial pour l&#8217;iPhone</a>.<br />
<span id="more-549"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;">&lt;?php
<span style="color: #11740a; font-style: italic;">//On inclue les librairies</span>
include<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">'nusoap.php'</span><span style="color: #002200;">&#41;</span>;
include<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">'database.php'</span><span style="color: #002200;">&#41;</span>;
$serveur <span style="color: #002200;">=</span> new soap_server;
<span style="color: #11740a; font-style: italic;">//On configure le serveur</span>
$serveur<span style="color: #002200;">-</span>&gt;configureWSDL<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">'Books'</span>, <span style="color: #bf1d1a;">'http://www.jkraft.fr/ws/serveur.php'</span>, <span style="color: #bf1d1a;">'http://www.jkraft.fr/ws/serveur.php?wsdl'</span><span style="color: #002200;">&#41;</span>;
$server<span style="color: #002200;">-</span>&gt;wsdl<span style="color: #002200;">-</span>&gt;schemaTargetNamespace <span style="color: #002200;">=</span><span style="color: #bf1d1a;">'http://www.jkraft.fr/ws/serveur.php'</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//On créer les schémas</span>
$serveur<span style="color: #002200;">-</span>&gt;wsdl<span style="color: #002200;">-</span>&gt;addComplexType<span style="color: #002200;">&#40;</span>
		<span style="color: #bf1d1a;">'Contact'</span>,
		<span style="color: #bf1d1a;">'complexType'</span>,
		<span style="color: #bf1d1a;">'struct'</span>,
		<span style="color: #bf1d1a;">'all'</span>,<span style="color: #bf1d1a;">''</span>,
		array<span style="color: #002200;">&#40;</span>
				<span style="color: #bf1d1a;">'nom'</span> <span style="color: #002200;">=</span>&gt; array<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">'name'</span> <span style="color: #002200;">=</span>&gt; <span style="color: #bf1d1a;">'nom'</span>, <span style="color: #bf1d1a;">'type'</span> <span style="color: #002200;">=</span>&gt; <span style="color: #bf1d1a;">'xsd:string'</span><span style="color: #002200;">&#41;</span>,
				<span style="color: #bf1d1a;">'prenom'</span> <span style="color: #002200;">=</span>&gt; array<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">'name'</span> <span style="color: #002200;">=</span>&gt; <span style="color: #bf1d1a;">'prenom'</span>, <span style="color: #bf1d1a;">'type'</span> <span style="color: #002200;">=</span>&gt; <span style="color: #bf1d1a;">'xsd:string'</span><span style="color: #002200;">&#41;</span>,
				<span style="color: #bf1d1a;">'web'</span> <span style="color: #002200;">=</span>&gt; array<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">'name'</span> <span style="color: #002200;">=</span>&gt; <span style="color: #bf1d1a;">'web'</span>, <span style="color: #bf1d1a;">'type'</span> <span style="color: #002200;">=</span>&gt; <span style="color: #bf1d1a;">'xsd:string'</span><span style="color: #002200;">&#41;</span>,
				<span style="color: #bf1d1a;">'tel'</span> <span style="color: #002200;">=</span>&gt; array<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">'name'</span> <span style="color: #002200;">=</span>&gt; <span style="color: #bf1d1a;">'tel'</span>, <span style="color: #bf1d1a;">'type'</span> <span style="color: #002200;">=</span>&gt; <span style="color: #bf1d1a;">'xsd:int'</span><span style="color: #002200;">&#41;</span>,
<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
&nbsp;
$serveur<span style="color: #002200;">-</span>&gt;wsdl<span style="color: #002200;">-</span>&gt;addComplexType<span style="color: #002200;">&#40;</span>
	<span style="color: #bf1d1a;">'ContactArray'</span>,
	<span style="color: #bf1d1a;">'complexType'</span>,
	<span style="color: #bf1d1a;">'array'</span>,<span style="color: #bf1d1a;">''</span>,
	<span style="color: #bf1d1a;">'SOAP-ENC:Array'</span>,
	array<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>,
	array<span style="color: #002200;">&#40;</span>
	array<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">'ref'</span><span style="color: #002200;">=</span>&gt;<span style="color: #bf1d1a;">'SOAP-ENC:arrayType'</span>,<span style="color: #bf1d1a;">'wsdl:arrayType'</span><span style="color: #002200;">=</span>&gt;<span style="color: #bf1d1a;">'tns:Contact[]'</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>,
	<span style="color: #bf1d1a;">'tns:Contact'</span>
<span style="color: #002200;">&#41;</span>;
&nbsp;
$serveur<span style="color: #002200;">-</span>&gt;register<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">'getContacts'</span>,
					array<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>, 
					array<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">'Contact'</span> <span style="color: #002200;">=</span>&gt; <span style="color: #bf1d1a;">'tns:ContactArray'</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>; 
&nbsp;
&nbsp;
$serveur<span style="color: #002200;">-</span>&gt;register<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">'addContact'</span>,
				array<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">'nom'</span> <span style="color: #002200;">=</span>&gt; <span style="color: #bf1d1a;">'xsd:string'</span>, <span style="color: #bf1d1a;">'prenom'</span> <span style="color: #002200;">=</span>&gt; <span style="color: #bf1d1a;">'xsd:string'</span>, <span style="color: #bf1d1a;">'email'</span> <span style="color: #002200;">=</span>&gt; <span style="color: #bf1d1a;">'xsd:string'</span>, <span style="color: #bf1d1a;">'tel'</span> <span style="color: #002200;">=</span>&gt; <span style="color: #bf1d1a;">'xsd:int'</span><span style="color: #002200;">&#41;</span>, array<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>; 
&nbsp;
<span style="color: #11740a; font-style: italic;">//Fonction qui recupere les contacts</span>
function getContacts<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span> 
$result <span style="color: #002200;">=</span> array<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>;
	$req<span style="color: #002200;">=</span><span style="color: #bf1d1a;">&quot;SELECT * FROM `Contacts`&quot;</span>;
	$res<span style="color: #002200;">=</span>mysql_query<span style="color: #002200;">&#40;</span>$req<span style="color: #002200;">&#41;</span>;
	<span style="color: #a61390;">while</span><span style="color: #002200;">&#40;</span>$obj<span style="color: #002200;">=</span>mysql_fetch_object<span style="color: #002200;">&#40;</span>$res<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		$result<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#93;</span> <span style="color: #002200;">=</span> array<span style="color: #002200;">&#40;</span> <span style="color: #bf1d1a;">'nom'</span> <span style="color: #002200;">=</span>&gt; $obj<span style="color: #002200;">-</span>&gt;nom, <span style="color: #bf1d1a;">'prenom'</span> <span style="color: #002200;">=</span>&gt; $obj<span style="color: #002200;">-</span>&gt;prenom,<span style="color: #bf1d1a;">'email'</span><span style="color: #002200;">=</span>&gt;$obj<span style="color: #002200;">-</span>&gt;email, <span style="color: #bf1d1a;">'tel'</span><span style="color: #002200;">=</span>&gt;$obj<span style="color: #002200;">-</span>&gt;tel<span style="color: #002200;">&#41;</span>;
	<span style="color: #002200;">&#125;</span>
<span style="color: #a61390;">return</span> $result;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">//Fonction qui ajoute un contacte dans la base</span>
function addContact<span style="color: #002200;">&#40;</span>$nom,$prenom,$email,$tel<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span> 
	$req<span style="color: #002200;">=</span><span style="color: #bf1d1a;">&quot;INSERT INOT `Contacts` (`id`, `nom`, `prenom`, `email`, `tel`) values ('', '$nom', '$prenom' ,'$email', '$tel')&quot;</span>;
	mysql_query<span style="color: #002200;">&#40;</span>$req<span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
$HTTP_RAW_POST_DATA <span style="color: #002200;">=</span> isset<span style="color: #002200;">&#40;</span>$HTTP_RAW_POST_DATA<span style="color: #002200;">&#41;</span> ? $HTTP_RAW_POST_DATA <span style="color: #002200;">:</span> <span style="color: #bf1d1a;">''</span>;
$serveur<span style="color: #002200;">-</span>&gt;service<span style="color: #002200;">&#40;</span>$HTTP_RAW_POST_DATA<span style="color: #002200;">&#41;</span>;
&lt;<span style="color: #002200;">/</span>php&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.jkraft.fr/2010/07/19/serveur-webservice-soap/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Créer un Webservice en PHP avec NuSoap</title>
		<link>http://www.jkraft.fr/2008/11/07/creer-un-webservice-en-php-avec-nusoap/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=creer-un-webservice-en-php-avec-nusoap</link>
		<comments>http://www.jkraft.fr/2008/11/07/creer-un-webservice-en-php-avec-nusoap/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 17:04:58 +0000</pubDate>
		<dc:creator>kraft</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[webservices]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.jkraft.fr/?p=122</guid>
		<description><![CDATA[Allez un petit tuto en PHP. Cette fois sur les webservices. On va créer un serveur et un client. PHP5 possède ses propres fonctions pour ca, ici on va utiliser la classe NuSoap que je trouve pratique et simple. Récupérable ici. I) Le serveur &#60;? include('lib/nusoap.php'); $serveur = new soap_server; $serveur-&#62;register('bonjour'); function bonjour($prenom) { return [...]]]></description>
			<content:encoded><![CDATA[<p>Allez un petit tuto en PHP. Cette fois sur les webservices. On va créer un serveur et un client. PHP5 possède ses propres fonctions pour ca, ici on va utiliser la classe NuSoap que je trouve pratique et simple. Récupérable <a href="http://sourceforge.net/projects/nusoap/" target="_blank">ici</a>.</p>
<p>I) <strong>Le serveur</strong></p>
<p><code>&lt;?<br />
include('lib/nusoap.php');<br />
$serveur = new soap_server;<br />
$serveur-&gt;register('bonjour');<br />
function bonjour($prenom)<br />
{<br />
return "Bonjour ".$prenom;<br />
}<br />
$serveur-&gt;service($HTTP_RAW_POST_DATA);<br />
?&gt;</code></p>
<p>Ligne 3 : on créer une instance de serveur<br />
Ligne 4 : on enregistre une méthode &laquo;&nbsp;bonjour&nbsp;&raquo;<br />
Ligne 5 : on défini la méthode &laquo;&nbsp;bonjour&nbsp;&raquo;, cela retourne un texte avec la variable passée.<br />
Ligne 9 : on envoie le résultat.</p>
<p>II) <strong>Le client</strong></p>
<p><code>&lt;?php<br />
require_once('lib/nusoap.php');<br />
$serverpath ='http://url-de-ma-page-serveur';<br />
$param = array('prenom'=&gt;'Jerome');<br />
$client = new soapclient($serverpath);<br />
$result = $client-&gt;call('bonjour', $param);<br />
print($client-&gt;request);<br />
?&gt;</code></p>
<p>Ligne 3 : l&#8217;url du serveur<br />
Ligne 4 : le tableau des paramètres à passer<br />
Ligne 5 : on créé le client<br />
Ligne 6 : l&#8217;appelle à la fonction &#8216;bonjour&#8217; et les paramètres.<br />
Ligne 7 : on affiche le resultat.</p>
<p>C&#8217;est un exemple d&#8217;utilisation simple. Il est possible de passer un message soap précis, de forcer le nommage dans le xml etc&#8230;<br />
Ca sera pour un prochain tuto <img src='http://www.jkraft.fr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Autre tuto : <a href="http://www.jkraft.fr/2010/11/05/php-retourner-un-tableau-avec-nusoap/">http://www.jkraft.fr/2010/11/05/php-retourner-un-tableau-avec-nusoap/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jkraft.fr/2008/11/07/creer-un-webservice-en-php-avec-nusoap/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Php 5, GD et Jpeg</title>
		<link>http://www.jkraft.fr/2008/08/11/php-5-gd-et-jpeg/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=php-5-gd-et-jpeg</link>
		<comments>http://www.jkraft.fr/2008/08/11/php-5-gd-et-jpeg/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 12:09:42 +0000</pubDate>
		<dc:creator>kraft</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[Serveur]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[gd]]></category>
		<category><![CDATA[jpeg]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://www.jkraft.fr/?p=27</guid>
		<description><![CDATA[Installer GD et Jpeg. Installer Jpeg-6b : # cd /usr/local/src/ # wget ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz # tar xzvf jpegsrc.v6b.tar.gz # cd jpeg-6b # ./configure --prefixe=/usr # make &#38;&#38; make install Si ça retourne une erreur, refaire la même chose sans le &#8211;prefix Recompiler php : # ./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-dom --with-iconv --enable-mbstring=all --enable-mbregex --with-mysql --with-zlib=/usr --with-jpeg-dir=../jpeg-6b --with-gd # [...]]]></description>
			<content:encoded><![CDATA[<p>Installer GD et Jpeg.</p>
<p>Installer Jpeg-6b :</p>
<p><code># cd /usr/local/src/<br />
# wget  ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz<br />
# tar xzvf </code><code>jpegsrc.v6b.tar.gz<br />
# cd jpeg-6b<br />
</code><code># ./configure --prefixe=/usr<br />
# make &amp;&amp; make install</code></p>
<p>Si ça retourne une erreur, refaire la même chose sans le &#8211;prefix</p>
<p>Recompiler php :</p>
<p><code># ./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-dom --with-iconv --enable-mbstring=all --enable-mbregex --with-mysql --with-zlib=/usr --with-jpeg-dir=../jpeg-6b --with-gd<br />
# make clean  &amp;&amp; Make &amp;&amp; make install</code></p>
<p>Le <em>make clean</em> est important!!!!!</p>
<p>Et voilà , vérifier dans le phpinfo que tout est correctement configuré. Mais on devrait avoir un php avec GD et Jpeg prêt !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jkraft.fr/2008/08/11/php-5-gd-et-jpeg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation d&#8217;un serveur FreeBSD minimal</title>
		<link>http://www.jkraft.fr/2008/05/12/installation-dun-serveur-freebsd-minimal/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installation-dun-serveur-freebsd-minimal</link>
		<comments>http://www.jkraft.fr/2008/05/12/installation-dun-serveur-freebsd-minimal/#comments</comments>
		<pubDate>Mon, 12 May 2008 12:48:36 +0000</pubDate>
		<dc:creator>kraft</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[Serveur]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[FreeBsd]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[webmin]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://www.jkraft.fr/?p=19</guid>
		<description><![CDATA[On va faire une petite installation minimal, puis installer Webmin pour l&#8217;administration à distance et Apache 2 /Php 5 / Mysql. I) Installation de FreeBSD Introduisez le premier CD de FreeBSD. Choisissez la langue, puis le clavier Sélectionnez Begin a standard installation Vous devez choisir le disque dur sur lequel installer FreeBSD (A pour choisir [...]]]></description>
			<content:encoded><![CDATA[<p>On va faire une petite installation minimal, puis installer Webmin pour l&#8217;administration à  distance et Apache 2 /Php 5 / Mysql.<span id="more-19"></span></p>
<p><strong>I) Installation de FreeBSD</strong></p>
<p>Introduisez le premier CD de FreeBSD.</p>
<ol>
<li>Choisissez la langue, puis le clavier</li>
<li>Sélectionnez <em>Begin a standard installation</em></li>
<li>Vous devez choisir le disque dur sur lequel installer FreeBSD (A pour choisir le disque entier, Q pour terminer)</li>
<li>Comme je n&#8217;installe que ce système je ne met pas de Boot Manager (None)</li>
<li>Créez les partitions (A pour la création automatique, Q pour terminer)</li>
<li>Choisissez l&#8217;installation minimal</li>
<li>Sélectionnez l&#8217;installation à  partir du CD/DVD</li>
<li>Continuez l&#8217;installation, il va maintenant formater le disque, créer les partitions et installer le système</li>
<li>Une fois l&#8217;installation terminée, configurez votre carte réseau (Mettez bien un nom d&#8217;hôte avec un .com / .fr etc.. )</li>
<li>Configurez les services dont vous avez besoin</li>
<li>Ajoutez les comptes utilisateurs et votre mot de passe root</li>
<li>Vous êtes de nouveau sur le menu. Sélectionnez <em>Configure</em> puis <em>Distributions</em> pour installer les ports et les man-pages. Si vous avez un soucis avec l&#8217;installation par CD/DVD changer le média type et passer par une installation FTP.</li>
</ol>
<p><strong>II) Webmin</strong></p>
<p>En premier on installe webmin. C&#8217;est une interface web qui permet d&#8217;administrer très facilement le serveur. On va donc utiliser les ports qui est une bibliothèque d&#8217;applications et d&#8217;utilitaires.</p>
<p>Donc on y va :</p>
<p><code># cd /usr/ports/sysutils/webmin<br />
# make install clean<br />
</code></p>
<p>Webmin est automatiquement téléchargé et installé dans : /usr/local/lib/webmin/</p>
<p>On va maintenant le configurer.</p>
<p><code># cd /usr/local/lib/webmin/<br />
# ./setup.sh<br />
</code></p>
<p>Validez les infos, et modifiez les pour votre config. Personnellement je laisse tout par défaut, port 10000 et pas de SSL.  Entrez le login et mot de passe admin.</p>
<p>Modifiez /etc/rc.conf et ajoutez la ligne webmin_enable=&nbsp;&raquo;YES&nbsp;&raquo; (vous pouvez utiliser <em>vi </em>pour le modifier)<br />
<code># echo webmin_enable=\"YES\" &gt;&gt; /etc/rc.conf</code></p>
<p>Redémarrer et dans votre navigateur aller sur : http://votre-ip:10000</p>
<p>Je n&#8217;explique pas comment Webmin fonctionne. C&#8217;est assez simple.</p>
<p><strong>III) Wget<br />
</strong><br />
On install l&#8217;outil Wget qui permet de télécharger via le terminal.</p>
<p><code># cd /usr/ports/ftp/wget<br />
# make install clean<br />
</code></p>
<p><strong>IV) Installer MySql 5 Client et Serveur</strong></p>
<p>On utilise encore les ports pour le client</p>
<p><code># cd /usr/ports/database/mysql50-client<br />
# make install clean<br />
</code></p>
<p>Pour le serveur, c&#8217;est un petit peu plus compliqué</p>
<p><code># cd /usr/src/<br />
# wget http://mir2.ovh.net/ftp.mysql.com/Downloads/MySQL-5.0/mysql-5.0.51b.tar.gz</code></p>
<p>Comme la procédure est un peu longue je ne vais pas la décrire ici. Mais suivez ce tutorial très simple.</p>
<p><a href="http://freed0.developpez.com/mysql/" target="_blank">http://freed0.developpez.com/mysql/</a></p>
<p><strong> V) Apache 2 et Php 5</strong></p>
<p>Dans un premier temps il faut installer un pré-requis libxml2</p>
<p><code># /usr/ports/textproc/libxml2<br />
# make install clean</code></p>
<p>Puis GD pour la gestion des images</p>
<p><code># /usr/ports/graphics/gd<br />
# make install clean</code></p>
<p>Il suffit de suivre mon tutorial <a href="http://www.jkraft.fr/?p=1">Compilation Apache 2 et Php 5</a>. Pour la configuration Apache avant la compilation juste mettre <em>&#8211;enable-so</em> comme argument.</p>
<p>Et voilà . Votre serveur est prêt à être utilisé. Pour toutes questions : <a href="mailto:contact@jkraft.fr">contact@jkraft.fr</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jkraft.fr/2008/05/12/installation-dun-serveur-freebsd-minimal/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Script Php et tache Cron</title>
		<link>http://www.jkraft.fr/2008/04/01/script-php-et-tache-cron/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=script-php-et-tache-cron</link>
		<comments>http://www.jkraft.fr/2008/04/01/script-php-et-tache-cron/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 08:49:26 +0000</pubDate>
		<dc:creator>kraft</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[Serveur]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://www.jkraft.fr/?p=18</guid>
		<description><![CDATA[Il existe plusieurs méthodes pour faire exécuter un script php comme tache cron. Je vais présenter celle que j&#8217;utilise (car elle fonctionne à tous les coups). Il suffit de faire appeler le script via la commande lynx. Lynx étant un navigateur web textuel. Vous pouvez essayer de taper #lynx http://www.macfan.fr Et vous naviguerez en mode [...]]]></description>
			<content:encoded><![CDATA[<p>Il existe plusieurs méthodes pour faire exécuter un script php comme tache cron. Je vais présenter celle que j&#8217;utilise (car elle fonctionne à  tous les coups).</p>
<p><span id="more-18"></span></p>
<p>Il suffit de faire appeler le script via la commande <em>lynx</em>. <em>Lynx</em> étant un navigateur web textuel. Vous pouvez essayer de taper</p>
<p><code>#lynx http://www.macfan.fr</code></p>
<p>Et vous naviguerez en mode texte. Pas très esthétique, mais très pratique si vous voulez exécuter un script. Il vous suffit de rajouter la ligne suivante à  votre fichier de configuration de cron.</p>
<p><code>0 2 * * * lynx http://url-votresite/script.php</code></p>
<p>Ce qui aura pour effet d&#8217;exécuter votre script tous les jours à  2h du matin. Si vous n&#8217;avez pas <em>lynx</em>, la commande <em>wget</em> fonctionne aussi, mais téléchargera le fichier résultat dans un dossier du serveur.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jkraft.fr/2008/04/01/script-php-et-tache-cron/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Php5 et Curl</title>
		<link>http://www.jkraft.fr/2008/03/19/php5-et-curl/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=php5-et-curl</link>
		<comments>http://www.jkraft.fr/2008/03/19/php5-et-curl/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 14:55:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Développement]]></category>
		<category><![CDATA[Serveur]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[FreeBsd]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://www.jkraft.fr/?p=9</guid>
		<description><![CDATA[Un petit article sur comment installer Curl et configurer Php 5 pour avoir accès à ces fonctions qui peuvent s&#8217;avérer très utile. Curl permet de vous connecter, de communiquer avec de nombreux serveurs, grâce à de nombreux protocoles. Installation de Curl : On récupère le package # wget http://curl.haxx.se/download/curl-7.16.0.tar.gz On dÃ©compresse le fichier # tar [...]]]></description>
			<content:encoded><![CDATA[<p>Un petit article sur comment installer Curl et configurer Php 5 pour avoir accès à  ces fonctions qui peuvent s&#8217;avérer très utile. Curl permet de vous connecter, de communiquer avec de nombreux serveurs,     grâce à  de nombreux protocoles. <span id="more-9"></span></p>
<p><strong>Installation de Curl :</strong></p>
<p>On récupère le package<br />
<code># wget http://curl.haxx.se/download/curl-7.16.0.tar.gz</code><br />
On dÃ©compresse le fichier<br />
<code># tar zxvf curl-7.16.0.tar.gz</code></p>
<p>On configure et on installe<br />
<code># cd curl-7.16.0<br />
# ./configure --prefix=/usr/loca/curl<br />
# make &amp;&amp; make install</code></p>
<p>Curl est maintenant installé. Il faut recompiler Php avec l&#8217;option <em>&#8211;with-curl=&lt;dir&gt;</em></p>
<p>Je vais reprendre les options utilisées dans mon article sur la <a href="http://www.jkraft.fr/?p=1">compilation de Php 5</a>.</p>
<p><strong>Configuration de Php 5<br />
</strong></p>
<p>On configure Php 5<br />
<code># cd /php-5.2.5<br />
# ./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-dom --with-iconv --enable-mbstring=all --enable-mbregex --with-mysql --with-gd --with-zlib</code></p>
<p>On le compile et on l&#8217;installe<br />
<code># make &amp;&amp; make install</code></p>
<p>Les fonctions Curl sont maintenant accessibles. Voilà  un petit exemple d&#8217;utilisation :</p>
<p><code>&lt;?<br />
// Création d'une nouvelle ressource cURL<br />
$ch = curl_init();<br />
// Configuration de l'URL et d'autres options<br />
curl_setopt($ch, CURLOPT_URL, "http://www.google.fr");<br />
curl_setopt($ch, CURLOPT_HEADER, 0);<br />
// Récupération de l'URL et affichage sur le naviguateur<br />
curl_exec($ch);<br />
// Fermeture de la session cURL<br />
curl_close($ch);<br />
?&gt;</code></p>
<p>Pour en savoir plus sur Curl, un petit tour sur la doc de Php 5 : <a href="http://fr3.php.net/curl" target="_blank">http://fr3.php.net/curl </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jkraft.fr/2008/03/19/php5-et-curl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compilation de PHP 5 et Apache 2</title>
		<link>http://www.jkraft.fr/2008/02/15/apache-php/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=apache-php</link>
		<comments>http://www.jkraft.fr/2008/02/15/apache-php/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 07:54:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Serveur]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[compilation]]></category>
		<category><![CDATA[FreeBsd]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://www.jkraft.fr/?p=1</guid>
		<description><![CDATA[Allez, un premier tuto sur la compilation de ces 2 outils indispensables. On va installer Apache 2 et PHP 5 en tant que module avec les options classiques sur un serveur sous Debian. Installer Apache On récupère les sources : # wget http://apache.crihan.fr/dist/httpd/httpd-2.2.8.tar.gz On décompresse puis on configure : # tar xzvf httpd-2.2.8.tar.gz # cd [...]]]></description>
			<content:encoded><![CDATA[<p>Allez, un premier tuto sur la compilation de ces 2 outils indispensables. On va installer Apache 2 et PHP 5 en tant que module avec les options classiques sur un serveur sous Debian.<span id="more-1"></span></p>
<p><strong> Installer Apache</strong></p>
<p>On récupère les sources :<br />
<code># wget http://apache.crihan.fr/dist/httpd/httpd-2.2.8.tar.gz</code></p>
<p>On décompresse puis on configure :<br />
<code># tar xzvf httpd-2.2.8.tar.gz<br />
# cd httpd-2.2.8</code></p>
<p>Pour permettre le chargement dynamique de PHP, le serveur Apache doit être compilé avec le support Dynamic Shared Object (DSO). Cette fonctionnalité peut être activée en ajoutant l&#8217;option <em>&#8211;enable-so :</em></p>
<p><code># ./configure --prefix=/usr/local/apache2 --enable-so</code></p>
<p>On compile et on installe :</p>
<p><code># make &amp;&amp; make install</code></p>
<p>Voilà  Apache 2 installé dans le répertoire /usr/local/apache2.</p>
<p><strong>Installer PHP 5</strong></p>
<p>J&#8217;ai eu des soucis avec php 5.1.6, je n ai pas réussi à  le faire fonctionner avec apache  2.2.8. Je vous conseille donc de prendre la dernière version. A l&#8217;heure actuelle c&#8217;est la 5.2.5. On récupère donc les sources puis on décompresse l&#8217;archive.</p>
<p><code># wget http://fr2.php.net/distributions/php-5.2.5.tar.gz</code></p>
<p><code># tar xzvf php-5.2.5.tar.gz<br />
# cd php-5.2.5</code></p>
<p>L&#8217;étape de configuration de PHP est très importante. C&#8217;est là  que vous allez définir les modules dont vous allez avoir besoin. Voilà  un exemple :</p>
<p><code># ./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-dom  --with-iconv --enable-mbstring=all --enable-mbregex  --with-mysql --with-gd --with-zlib</code></p>
<ul>
<li>L&#8217;argument <em>&#8211;with-apxs2 </em>indique Ã  PHP où se trouve le répertoire d&#8217;installation d&#8217;Apache 2 et le script <em>apxs</em> qui gère les extensions.</li>
<li>L&#8217;argument <em>&#8211;enable-dom </em>permet d&#8217;utiliser l&#8217;API DOM de php5 pour utiliser des documents XML.</li>
<li>L&#8217;argument <em>&#8211;with-iconv</em> permet de convertir des fichiers vers différent jeux de charactères.</li>
<li>L&#8217;argument <em>&#8211;enable-mbstring </em>d&#8217;utiliser différent jeux de charactères.</li>
<li>L&#8217;argument <em>&#8211;enable-mbregex </em>active les fonctions regex.</li>
<li>L&#8217;argument &#8211;with-mysql active l&#8217;extension MySQL <em>regular</em>. Dans PHP 5.0, elle n&#8217;est pas active par défaut (contrairement à  PHP 4.0) et doit être nommée explicitement dans <em>configure</em> pour être activée.</li>
<li>L&#8217;argument <em>&#8211;with-gd</em> active les fonctions de manipulation d&#8217;images.</li>
<li>l&#8217;argument <em>&#8211;with-zlib</em> active la bibliothèque de compression zlib pour la compression de données à  la volée.</li>
</ul>
<p>D&#8217;autres options et extensions sont également possibles. Pour obtenir une liste complète, exécutez la commande suivante:</p>
<p><code># ./configure --help</code></p>
<p>Une fois que le script <em>configure</em> a terminé son traitement, vous pouvez compiler et installer PHP.</p>
<p><code># make<br />
# make install</code></p>
<p><strong>Configurer et tester Apache avec PHP</strong></p>
<p>Dernière petite manipulation pour que tout fonctionne, dire à  Apache de reconnaitre les fichiers .php et pour cela on va aller ajouter dans le fichier /usr/local/apache2/conf/httpd.conf la ligne suivante :</p>
<p><code>AddType application/x-httpd-php .php</code></p>
<p>Enregistrez le fichier, puis démarrez le serveur:</p>
<p><code># /usr/local/apache2/bin/apachectl start</code></p>
<p>Vous pouvez maintenant tester si tout fonctionne. La racine des documents du serveur se trouve la : /usr/local/apache2/htdocs/<br />
Il suffit de créer un fichier PHP avec par exemple le code suivant :</p>
<p><code>&lt;?php phpinfo(); ?&gt;</code></p>
<p>Connectez vous sur l&#8217;url http://localhost/<em>nom-de-votre-fichier</em>.php et vous devriez voir la page d&#8217;informations de PHP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jkraft.fr/2008/02/15/apache-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

