<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/features.commandline.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'features.commandline.introduction.php',
    1 => 'Introduzione',
    2 => 'Introduzione',
  ),
  'up' => 
  array (
    0 => 'features.commandline.php',
    1 => 'Command line usage',
  ),
  'prev' => 
  array (
    0 => 'features.commandline.php',
    1 => 'Command line usage',
  ),
  'next' => 
  array (
    0 => 'features.commandline.differences.php',
    1 => 'Differenze con gli altri SAPI',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'features/commandline.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="features.commandline.introduction" class="section">
  <h2 class="title">Introduzione</h2>
  
  <p class="para">
   L&#039;obiettivo principale di <abbr title="Command Line Interpreter/Interface">CLI</abbr> <abbr title="Server Application Programming Interface">SAPI</abbr>
   è quello di sviluppare applicazioni shell con PHP. Esistono
   alcune differenze tra la <abbr title="Command Line Interpreter/Interface">CLI</abbr> <abbr title="Server Application Programming Interface">SAPI</abbr> e le altre
   <abbr title="Server Application Programming Interface">SAPI</abbr>; queste saranno illustrate nel corrente capitolo. Val la pena
   ricordare che <abbr title="Command Line Interpreter/Interface">CLI</abbr> e <abbr title="Common Gateway Interface">CGI</abbr> sono differenti
   <abbr title="Server Application Programming Interface">SAPI</abbr> sebbene condividano il medesimo comportamento in diverse situazioni.
  </p>

  <p class="para">
   La <abbr title="Command Line Interpreter/Interface">CLI</abbr> <abbr title="Server Application Programming Interface">SAPI</abbr> è abilitata di default con l&#039;opzione
   <strong class="option configure">--enable-cli</strong>, ma può esseredisattivata usando
   <strong class="option configure">--disable-cli</strong> quando si usa il comando
   <strong class="command">./configure</strong>.
  </p>
  
  <p class="para">
   Il nome, la posizione, e l&#039;esistenza di eseguibili <abbr title="Command Line Interpreter/Interface">CLI</abbr>/<abbr title="Common Gateway Interface">CGI</abbr>
   differiranno in base a come il PHP sarà installato sul sistema. Per
   default quando si esegue il <strong class="command">make</strong>, si compila sia la versione <abbr title="Common Gateway Interface">CGI</abbr>
   sia la versione <abbr title="Command Line Interpreter/Interface">CLI</abbr> e saranno poste rispettivamente in <var class="filename">sapi/cgi/php-cgi</var> e
   <var class="filename">sapi/cli/php</var> a partire dalla directory dei sorgenti.
   Occorre notare che entrambi gli eseguibili sono chiamati <code class="literal">php</code>. Ciò che accade durante
   l&#039;esecuzione di <strong class="command">make install</strong> dipende dalla linea di configurazione. Se durante
   la configurazione si è scelto un modulo <abbr title="Server Application Programming Interface">SAPI</abbr>, tipo apxs, o si è attivato
   <strong class="option configure">--disable-cgi</strong>, l&#039;eseguibile <abbr title="Command Line Interpreter/Interface">CLI</abbr> viene
   copiato in <var class="filename">{PREFIX}/bin/php</var>
   durante <strong class="command">make install</strong>, altrimenti in questa cartella sarà posto l&#039;eseguibile
   <abbr title="Common Gateway Interface">CGI</abbr>. Così, per esempio, se si ha come parametro di configurazione
   <strong class="option configure">--with--apxs</strong> allora l&#039;eseguibile <abbr title="Command Line Interpreter/Interface">CLI</abbr> sarà copiato in <var class="filename">{PREFIX}/bin/php
   </var> durante <strong class="command">make install</strong>. Se si vuole evitare
   l&#039;installazione dell&#039;eseguibile <abbr title="Common Gateway Interface">CGI</abbr>, utilizzare <strong class="command">make
   install-cli</strong> dopo <strong class="command">make install</strong>. In alternativa
   si può specificare <strong class="option configure">--disable-cgi </strong> nella linea di
   configurazione.
  </p>
  
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <p class="para">
    Poiché sia <strong class="option configure">--enable-cli</strong> sia 
    <strong class="option configure">--enable-cgi</strong> sono abilitati per default,
    avere semplicemente <strong class="option configure">--enable-cli</strong> nella linea
    di configurazione non significa necessariamente che l&#039;eseguibile <abbr title="Command Line Interpreter/Interface">CLI</abbr> sia copiato come
    <var class="filename">{PREFIX}/bin/php</var> con l&#039;esecuzione di <strong class="command">make install</strong>.
   </p>
  </p></blockquote>
  
  <p class="para">
   La versione <abbr title="Command Line Interpreter/Interface">CLI</abbr> viene inserita nella cartella principale, con il nome <var class="filename">
   php.exe</var> in Windows. La versione <abbr title="Common Gateway Interface">CGI</abbr> è
   chiamata <var class="filename">php-cgi.exe</var>. Inoltre, è distribuito un file chiamato <var class="filename">
   php-win.exe</var> se PHP è configurato con
   <strong class="option configure">--enable-cli-win32</strong>. Questo è equivalente alla
   versione <abbr title="Command Line Interpreter/Interface">CLI</abbr>, tranne che php-win non visualizzerà nulla
   e quindi non vi sarà la finestra di console.
  </p>
  
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <strong>Quale SAPI ho?</strong><br />  
   <p class="para">
    Da shell, digitando <strong class="command">php -v</strong> si avrà l&#039;informazione di
    quale <var class="filename">php</var> si tratta, <abbr title="Common Gateway Interface">CGI</abbr> o <abbr title="Command Line Interpreter/Interface">CLI</abbr>. Vedere
    anche la funzionei <span class="function"><a href="function.php-sapi-name.php" class="function">php_sapi_name()</a></span> e la costante
    <strong><code><a href="reserved.constants.php#constant.php-sapi">PHP_SAPI</a></code></strong> per dettagli.
   </p>
  </p></blockquote>

  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <p class="para">
    Una pagina stile <code class="literal">man</code> di Unix è disponibile digitando <strong class="command">man
    php</strong> da linea di comando.
   </p>
  </p></blockquote>
 </div><?php manual_footer($setup); ?>