[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[un poil HS] PB de script php



Salut liste,

j'utilisais depuis un moment un script PHP achetement pratique puisqu'il
permet d'appeler d'autres scripts en n'importe quel langage sans passer
par les lourdeurs de fcgi.

Le PB, c'est que depuis le dist upgrade en wheezy, ben ça môrchepû
(erreur 404) au lieu de la page Pale d'awstats:(

Je subodore un PB PHP mais c'est pas mon truc ça.
Il-y-a t'il une bonne âme qui pourrait me dire d'où ça pourrait venir?



<?php

// Piqué sur:   http://forum.slicehost.com/index.php?p=/discussion/2561/setup-awstats-on-my-nginx-server/p1

$descriptorspec = array(
    0 => array("pipe", "r"),  // stdin is a pipe that the child will read from
    1 => array("pipe", "w"),  // stdout is a pipe that the child will write to
    2 => array("pipe", "w")   // stderr is a file to write to
);

$newenv = $_ENV;
$newenv["SCRIPT_FILENAME"] = $_ENV["X_SCRIPT_FILENAME"];
$newenv["SCRIPT_NAME"] = $_ENV["X_SCRIPT_NAME"];

if (is_executable($_ENV["X_SCRIPT_FILENAME"])) {
    $process = proc_open($_ENV["X_SCRIPT_FILENAME"], $descriptorspec, $pipes, NULL, $newenv);
    if (is_resource($process)) {
        fclose($pipes[0]);
        $head = fgets($pipes[1]);
        while (strcmp($head, "\n")) {
            header($head);
            $head = fgets($pipes[1]);
        }
        fpassthru($pipes[1]);
        fclose($pipes[1]);
        fclose($pipes[2]);
        $return_value = proc_close($process);
    }
    else {
        header("Status: 500 Internal Server Error");
        echo("Internal Server Error (500) - SCRIPT /usr/lb/cgi-bin/cgi-bin.php THAT ALLOWS LANGUAGE-X SCRIPTS CALLS");
    }
}
else {
    header("Status: 404 Page Not Found");
    echo("Page Not Found (404) - SCRIPT /usr/lb/cgi-bin/cgi-bin.php THAT ALLOWS LANGUAGE-X SCRIPTS CALLS");
}
?>


-- 
<trax> tu prépares quoi comme bac ?
<rajae> LETRE
<trax> ah...


Reply to: