Problème incompréhensible...

keithsize Messages postés 5 Date d'inscription samedi 19 avril 2003 Statut Membre Dernière intervention 16 janvier 2009 - 16 janv. 2009 à 16:13
keithsize Messages postés 5 Date d'inscription samedi 19 avril 2003 Statut Membre Dernière intervention 16 janvier 2009 - 16 janv. 2009 à 16:41
bonjour,
alors voila sur une page php j'ai un script qui génére un fichier avec un ID:

//La fonction génère un id aléatoire
function ID() {
    srand(time());
    $a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
     for($i; $i<=16; $i++) {
         $id.=substr($a, (rand()%(strlen($a))),1);
     }
    return(md5($id));
}
$id=ID();

//on génère le fichier dans le repertoire mails
$file = "/homez.22/gogel/www/mails/$id.php";
$fo = fopen("$file","a");
chmod($file, 0777);

admettons que l'id généré est rgerrg876rg778fgfgjk4435hh

et le pb est que quand dans la barre d'adresse je rentre http://gogel/mails/rgerrg876rg778fgfgjk4435hh.php et bien je narrive pas y accéder, pourtant le fichier est bien mis dans le repertoire mails, mails et ce fichier on un CHMOD 777, j'ai le message suivant :
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [mailto:postmaster@gogel.fr postmaster@gogel.fr] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

et le truc le plus étrange c'est que lorsque je génére le fichier dans ma racine cad :
$file = "/homez.22/gogel/www/$id.php";
ça marche...
je suis sous OVH
merci de vos réponses

sqd

1 réponse

keithsize Messages postés 5 Date d'inscription samedi 19 avril 2003 Statut Membre Dernière intervention 16 janvier 2009
16 janv. 2009 à 16:41
j'ai trouvé,


en faite il faut mettre le cdhmod du fichier à 755 et non 777,,,


voila pour linfo

sqd
0
Rejoignez-nous