[UNIX] : Comment exécuter un script shell dans une page PHP
Bonjour à tous et à toute,
J'aimerais savoir comment exécuter un script shell dans une page PHP.
Je m'explique j'ai un script shell qui permet d'effacer des dossiers la page s'appel EFFACEDOSSIERCOMPLET.sh
Et ma page ou j'aimerais qu'il s'exécute est menu.php, je l'appel comme ceci mais ça ne fonctionne malheureusement pas ... :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| foreach ($listNumDossiers as $numDossier)
{
if($appli == 'HL7IDEOLOC')
{
//voir ce qu'il a retourné et l'exécuter
echo exec('EFFACEDOSSIERCOMPLET.sh $numDossier');
}
// Pour chaque numero de dossier, on l insert en base et on dit que la mise a jour a été faite!
$requeteInsert = " Insert into INTERNEW.HL7_REEMIS (SEQ, ABONNE, TYPE_MSG, FORMAT_MSG, NDA, NIP, DATE_REEMIS, ETAT_REEMIS, MODE_REEMIS)";
$requeteInsert .= " Values (HL7_REEMIS_SEQUENCE.NEXTVAL, '".$appli."', '".$TYPE_MSG."', '".$FORMAT_MSG."', '".$numDossier."','0', TO_DATE('31/12/2099 23:59:59', 'dd/mm/yyyy hh24:mi:ss'), '".$ETAT_REEMIS."', '".$MODE_REEMIS."')";
$resReq= exec_select( 'ORACLE8', 'TCPAGEI', $requeteInsert,'', $trace=true );
}
echo '<br/><br/>Votre réémission à bien été prise en compte !<br/>'; |
Merci d'avance,
Bonne journée =)