|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #79619 gethostname() should mention FQDN
Submitted: 2020-05-21 19:33 UTC Modified: 2020-05-22 14:01 UTC
From: lkmorlan at uwaterloo dot ca Assigned:
Status: Re-Opened Package: *Network Functions
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
16 - 14 = ?
Subscribe to this entry?

 [2020-05-21 19:33 UTC] lkmorlan at uwaterloo dot ca
From manual page:
The documentation does not say anything about whether the return value is a fully-qualified domain name or not; sometimes it is, sometimes it is not.

It should mention that it could return either and explain what causes it to do one or the other.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-05-21 19:57 UTC]
-Status: Open +Status: Not a bug
 [2020-05-21 19:57 UTC]
PHP is merely reporting what your system says. There's no logic about making it fully-qualified or not.
 [2020-05-21 20:51 UTC] lkmorlan at uwaterloo dot ca
I suggest adding:

The value is the output of the system hostname command. Depending on system configuration, this will be either the fully-qualified domain name or just the local part of the name.
 [2020-05-21 22:18 UTC]
-Status: Not a bug +Status: Re-Opened -Package: Documentation problem +Package: *Network Functions
 [2020-05-21 22:18 UTC]
I wouldn't even mention fully-qualified - just say that it's from the system, consult your system's documentation, the usual that we do for functions like this.
 [2020-05-22 14:01 UTC] lkmorlan at uwaterloo dot ca
OK, how about:

The value is the output of the system hostname command, which will depend on system configuration. Consult your system documentation.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Oct 21 09:03:34 2021 UTC