Forum de discussions NFrance - Support offres dédiées et mutualisées
Vous n'êtes pas identifié.
bonjour, je voudrais juste savoir si PHP5 est installé sur le pack web1, si il y a une manipulation à faire etc... en fait je ne suis pas très doué, mais j'ai un ami qui ma écrit un script en php pour mettre à jour ma gallerie, mais celui ne fonctionne pas (il semberait que ce soit la fonction "scandir") qui d'après des on dit ne serait compatible qu'avec le php5, d'autres part jai essayé de lancer tout bêtement quelques scripts en php à partir de mon site, jai souvent des erreurs , genre phpinfo.php me donne ce ci :
Warning: main(./libraries/grab_globals.lib.php): failed to open stream: No such file or directory in /home/******/phpinfo.php on line 9
Fatal error: main(): Failed opening required './libraries/grab_globals.lib.php' (include_path='.:/usr/local/php4/lib/php') in /home/******/phpinfo.php on line 9
les ***** étant mon identifiant
Peut-être ai-je omis quelque chose, je vous le rappelle je suis NUL en ce domaine.
Mon url
www.design-business.com
merci
Hors ligne
merci de la réponse mais ce qui est bizarre c que kan je lance :
http://www.design-business.com/info.php
cela me retourne PHP 4.42 !!
Hors ligne
est ce que si je vous envoie un script php, vous pouvez le tester??
Hors ligne
<html>
<head>
<title></title>
</head>
<body>
<?php
//This section defines the file to write to
$GalFile = "galleries2.txt";
$Gala = 0;
$Directories = scandir ('.');
foreach($Directories as $Directory ) {
if( is_dir( $Directory ) && $Directory != "." && $Directory != ".." ) {
Print "$Directory<BR>";
$Gala ++;
$GalBody = "$GalBody
&cat{$Gala}Id=$Gala&
&cat{$Gala}Name=$Directory&
&cat{$Gala}file=$Directory/images.txt&
&cat{$Gala}image=$Directory/tn/pic0.jpg&
";
}
}
//This defines the Header part of the file
$GalHeader =
" //This line must be left at the very beginning. Important!
&catcount=$Gala&
//What gallery number do you want to load first
//X=NO Default Gallery....R=Random Default Gallery....#(Any number to select which gallery as Default
&autoload=R&";
//This defines the Footer part of the file
$GalFooter =
" //Number of thumbs across
&horzthumbs=4&
//Number of thumbs down
&vertthumbs=3&
//Horizontal thumbs spacer
&hthumbsspacer=68&
//Vertical thumbs spacer
&vthumbsspacer=70&
//Slideshow timer in seconds
&slidesseconds=5&
//This line must be left at the very end. Important!
&done=1&";
//This takes all the parts and puts them together in one place
$GalResults = "$GalHeader
$GalBody
$GalFooter";
// This section opens and writes the file.
$fp = fopen( $GalFile,"w");
if(!$fp) die("&status=cannot write to file ......&");
fwrite($fp, $GalResults, 800000);
fclose( $fp );
// This section opens up the file declared above for reading
$fp = fopen($GalFile,"r");
$OldData = fread($fp, 80000);
fclose( $fp );
Print "Gallery file has been created<BR>";
echo "<BR>";
Print $OldData;
echo "<BR>";
Print "Records read = $Gala<BR>";
Print "=================================== End of ROOT ===================================<BR>";
$Gala = 0;
$Directories = scandir ('.');
foreach($Directories as $Directory ) {
if( is_dir( $Directory ) && $Directory != "." && $Directory != ".." ) {
Print "Folder = $Directory<BR>";
chdir($Directory);
//-------------------------------------------------------------------------------------------------------------------
//This section defines the file to write to
$myfile = "images2.txt";
$a = 0;
// This stores all the variables from the flash movie into php variables to work with
foreach (glob("*.jpg") as $filename) {
$a ++;
$Body = "$Body
&image$a=$filename&
&imagednload$a=YES&
&imagetitle$a=Picture-$a&
&imagedate$a=date&
&imagetext$a=This is Picture-$a&
";
}
//This defines the Header part of the file
$Header =
" //This line must be left at the very beginning. Important!
//Name of Gallery
&GalleryName=$Directory&
//Total number of images
&imagecount=$a&
//Folder with thumbnails
//If you leave this blank the gallery will create thumbs from your main images
&thumbsfolder=$Directory/tn/&
//Folder with main images
&imagefolder=$Directory/&
//Images #'s start here…";
//This defines the Footer part of the file
$Footer =
" //This line must be left at the very end. Important !
&done=1&";
//This takes all the parts and puts them together in one place
$Results = "$Header
$Body
$Footer";
// This section opens and writes the file.
$fp = fopen( $myfile,"w");
if(!$fp) die("&status=Cannot write to file ......&");
fwrite($fp, $Results, 800000);
fclose( $fp );
// This section opens up the file declared above for reading
$fp = fopen($myfile,"r");
$mydata = fread($fp, 80000);
fclose( $fp );
$Body = "";
Print "Images file has been created<BR>";
echo "<BR>";
Print "$mydata<BR>";
Print "Records read = $a<BR><BR>";
Print "============== End of $Directory ==============<BR>";
chdir('../');
//--------------------------------------------------------------------------------------------------------------
}
}
?>
</body>
</html>
Hors ligne
Avant que quelqu'un ne passe plus de temps à vous aider, avez-vous au moins essayé d'exécuter ce script dans un fichier ayant l'extension .php5 ?
Hors ligne
ok je viens de resoudre le problème, le fait de renommer en php5 était la bonne solution , mais imbécile que je suis j'avais oiublié la variable .txt
Cela fonctionne maintenant
merci infiniment de l'assistance
Hors ligne
Désoloé de vous demander pardon, mais je comprends mal. Disons que j'ai un wiki que je cherche à déménager. Il roule sous php5 en temps normal. Est-ce que je dois modifier l'extension de tous les fichiers php du wiki?
Merci pour vos réponses!
PS : j'utilise mediawiki.
Hors ligne
Bon, pour ceux que ça intéresse, j'ai finalement déduit que ce qu'il fallait mettre dans le .htaccess, c'est :
AddHandler php-fastcgi5 .php
J'ai trouvé l'info ici : http://forum.nfrance.com/p4742-01-12-20 … html#p4742
Merci à tous d'avoir pris le temps de me lire!!
Sacco
Hors ligne