Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

[PHP] Débutant en php

15 réponses
Avatar
stephane.martin
Bonsoir,

Je débute en php.......

J'ai fichier php qui resemble a cela :


<html>
<head>
<title>Test PHP</title>
</head>
<body>
<?php echo '<p>Bonjour</p>'; ?>
</body>
</html>

La page ne s'affiche pas quand je fais un local-host

Le serveur web est activé et php aussi

--
Stephane MARTIN

10 réponses

1 2
Avatar
sebastienmarty
Stéphane Martin wrote:

Bonsoir,

Je débute en php.......

J'ai fichier php qui resemble a cela :


<html>
<head>
<title>Test PHP</title>
</head>
<body>
<?php echo '<p>Bonjour</p>'; ?>
</body>
</html>

La page ne s'affiche pas quand je fais un local-host



Qu'appelles-tu "faire un local-host" ? Que tapes-tu exactement ?

Le serveur web est activé et php aussi



Sûr ? Que donne <?php phpinfo() ?> ?


--
[SbM]
"If the French were really intelligent, they'd speak English" (W. Sheed)
Avatar
Bruno
Stéphane Martin vient de nous annoncer :
Bonsoir,

Je débute en php.......

J'ai fichier php qui resemble a cela :


<html>
<head>
<title>Test PHP</title>
</head>
<body>
<?php echo '<p>Bonjour</p>'; ?>
</body>
</html>

La page ne s'affiche pas quand je fais un local-host

Le serveur web est activé et php aussi



tu l'as nommé index.php ?

--
Cordialement, Bruno
Avatar
stephane.martin
Bruno wrote:

u l'as nommé index.php ?



index.html et je l'ai mise dans WebServeur.
--
Stephane MARTIN
Avatar
sebastienmarty
Stéphane Martin wrote:

Bruno wrote:

> u l'as nommé index.php ?

index.html et je l'ai mise dans WebServeur.



Alors c'est normal que ça ne marche pas. Si ton fichier contient du php,
il faut que son nom porte l'extension ".php".

--
[SbM]
"If the French were really intelligent, they'd speak English" (W. Sheed)
Avatar
Bruno
Il se trouve que SbM a formulé :
Stéphane Martin wrote:

Bruno wrote:

u l'as nommé index.php ?



index.html et je l'ai mise dans WebServeur.



Alors c'est normal que ça ne marche pas. Si ton fichier contient du php,
il faut que son nom porte l'extension ".php".



toutafé !

--
Cordialement, Bruno
Avatar
stephane.martin
SbM wrote:

Alors c'est normal que ça ne marche pas. Si ton fichier contient du php,
il faut que son nom porte l'extension ".php".



Cela ne marche toujours pas ?


Dans mon fichier index.php :


<html>
<head>
<title>Test PHP</title>
</head>
<body>
<?php echo '<P>Bonjour</P>'; ?>
</body>
</html>


A l'affichage j'ai <

--
Stephane MARTIN
Avatar
sebastienmarty
Stéphane Martin wrote:

SbM wrote:

> Alors c'est normal que ça ne marche pas. Si ton fichier contient du php,
> il faut que son nom porte l'extension ".php".

Cela ne marche toujours pas ?


Dans mon fichier index.php :


<html>
<head>
<title>Test PHP</title>
</head>
<body>
<?php echo '<P>Bonjour</P>'; ?>
</body>
</html>


A l'affichage j'ai <



Et avec des " à la place des ' ?
Et avec print à la place d'echo ?

--
[SbM]
"If the French were really intelligent, they'd speak English" (W. Sheed)
Avatar
stephane.martin
SbM wrote:

Stéphane Martin wrote:

> SbM wrote:
>
> > Alors c'est normal que ça ne marche pas. Si ton fichier contient du php,
> > il faut que son nom porte l'extension ".php".
>
> Cela ne marche toujours pas ?
>
>
> Dans mon fichier index.php :
>
>
> <html>
> <head>
> <title>Test PHP</title>
> </head>
> <body>
> <?php echo '<P>Bonjour</P>'; ?>
> </body>
> </html>
>
>
> A l'affichage j'ai <

Et avec des " à la place des ' ?
Et avec print à la place d'echo ?



Cela ouvre mes différent répertoire Index OF :
--
Stephane MARTIN
Avatar
stephane.martin
Stéphane Martin wrote:

SbM wrote:

> Stéphane Martin wrote:
>
> > SbM wrote:
> >
> > > Alors c'est normal que ça ne marche pas. Si ton fichier contient du php,
> > > il faut que son nom porte l'extension ".php".
> >
> > Cela ne marche toujours pas ?
> >
> >
> > Dans mon fichier index.php :
> >
> >
> > <html>
> > <head>
> > <title>Test PHP</title>
> > </head>
> > <body>
> > <?php echo '<P>Bonjour</P>'; ?>
> > </body>
> > </html>
> >
> >
> > A l'affichage j'ai <
>
> Et avec des " à la place des ' ?
> Et avec print à la place d'echo ?

Cela ouvre mes différent répertoire Index OF :


Comme ceci

<http://cjoint.com/?BJmsOjae6xA>

--
Stephane MARTIN
Avatar
sebastienmarty
Stéphane Martin wrote:

Stéphane Martin wrote:

> SbM wrote:
>
> > Stéphane Martin wrote:
> >
> > > SbM wrote:
> > >
> > > > Alors c'est normal que ça ne marche pas. Si ton fichier contient
> > > > du php, il faut que son nom porte l'extension ".php".
> > >
> > > Cela ne marche toujours pas ?
> > >
> > >
> > > Dans mon fichier index.php :
> > >
> > >
> > > <html>
> > > <head>
> > > <title>Test PHP</title>
> > > </head>
> > > <body>
> > > <?php echo '<P>Bonjour</P>'; ?>
> > > </body>
> > > </html>
> > >
> > >
> > > A l'affichage j'ai <
> >
> > Et avec des " à la place des ' ?
> > Et avec print à la place d'echo ?
>
> Cela ouvre mes différent répertoire Index OF :
Comme ceci

<http://cjoint.com/?BJmsOjae6xA>



Euh... Tu le places où, exactement, ton fichier index.php ??? Et tu
tapes quoi, précisément, dans la barre d'adresse de ton navigateur ?

Parce que bon, je viens de tester ici et ça marche nickel : fichier
index.php dans ~/Sites, puis "localhost/~ton_nom/index.php", ça
m'affiche "Bonjour".

--
[SbM]
"If the French were really intelligent, they'd speak English" (W. Sheed)
1 2