Mon fichier index.php n'affiche pas "hello world"

Résolu/Fermé
NICOLAS3377 Messages postés 52 Date d'inscription samedi 20 août 2016 Statut Membre Dernière intervention 29 mars 2023 - 3 déc. 2018 à 18:27
NICOLAS3377 Messages postés 52 Date d'inscription samedi 20 août 2016 Statut Membre Dernière intervention 29 mars 2023 - 3 déc. 2018 à 19:16
Bonjour,


J'apprend le langage symfony 3 . En ayant créé le fichier index.php j'y met l'instruction echo 'Hello World';
Il n'affiche rien. Merci d'avance pour votre aide


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"xml:lang="fr">
	<head>
		<title>Mon premier fichier symfony</title>
		<meta http-equiv="Content-Type"content="text/html;charset=iso-8859-1"/>
<link href="style.css"rel="stylesheet"type="text/css"/>
	</head>
<? 
echo 'Hello World';
?>
</html>

Configuration: Windows / Firefox 63.0
A voir également:

1 réponse

jordane45 Messages postés 38138 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 avril 2024 4 649
3 déc. 2018 à 18:37
Bonjour,

La syntaxe
 <?   ?>  
ne fonction que si l'option open_short_tag est activée dans ton php....
Mais il vaut de toutes façons mieux éviter de l'utiliser.
A la place, utilise la vraie syntaxe
<?php  ?>

0
NICOLAS3377 Messages postés 52 Date d'inscription samedi 20 août 2016 Statut Membre Dernière intervention 29 mars 2023 1
3 déc. 2018 à 19:07
Bonsoir. Je viens de mettre la modification <?php ?> et ca marche. Le message "hello world s'affiche correctement.
Merci beaucoup.
0
jordane45 Messages postés 38138 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 avril 2024 4 649
3 déc. 2018 à 19:08
0
NICOLAS3377 Messages postés 52 Date d'inscription samedi 20 août 2016 Statut Membre Dernière intervention 29 mars 2023 1
3 déc. 2018 à 19:09
Le message "hello world" s'affiche correctement. Merci beaucoup.
0
jordane45 Messages postés 38138 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 avril 2024 4 649 > NICOLAS3377 Messages postés 52 Date d'inscription samedi 20 août 2016 Statut Membre Dernière intervention 29 mars 2023
3 déc. 2018 à 19:10
Oui j'ai bien lu la première fois.
Donc pense à mettre le sujet en RESOLU ...
Les explications se trouvent dans le lien que je t'ai donné :
https://www.commentcamarche.net/infos/25917-marquer-un-fil-de-discussion-comme-etant-resolu/
0
NICOLAS3377 Messages postés 52 Date d'inscription samedi 20 août 2016 Statut Membre Dernière intervention 29 mars 2023 1
3 déc. 2018 à 19:16
J'ai mis "hello world" deux fois car la première fois il manquait les guillemets de fermeture.
0