To the prev. note: **NEVER USE***
#`sudo hostname servername`
Some *nix systems will then force to set the 'servername' as new hostname!
(PHP 5 >= 5.3.0, PHP 7, PHP 8)
gethostname — Lit le nom de l'hôte
gethostname() lit le nom d'hôte standard pour la machine hôte.
Cette fonction ne contient aucun paramètre.
Retourne une chaîne avec le nom d'hôte, en cas de succès et
sinon false
.
Exemple #1 Exemple avec gethostname()
<?php
echo gethostname(); // doit afficher i.e : sandie
?>
To the prev. note: **NEVER USE***
#`sudo hostname servername`
Some *nix systems will then force to set the 'servername' as new hostname!
On Linux, use the command `hostname` to view your host name, or `sudo hostname servername` to set it