Hướng dẫn how do i find the hostname of a php server? - làm cách nào để tìm tên máy chủ của máy chủ php?
(PHP 5 >= 5.3.0, PHP 7, PHP 8) Show gethostname — Gets the host name Descriptiongethostname(): string|false ParametersThis function has no parameters. Return Values Returns a string with the hostname on success, otherwise ExamplesExample #1 A simple gethostname() example
See Also
markosjal AT Gmail ¶ 6 months ago
solaris ¶ 2 years ago
kurdtpage at gmail dot com ¶ 4 years ago
Mark Simon ¶ Richard York ¶ — Server and execution environment information Stefano (Thông tin tại Sarchittu Dot Org) ¶Danieltahar ¶ Chỉ sốBạn có thể hoặc không thể tìm thấy bất kỳ yếu tố nào sau đây trong $ _Server. Lưu ý rằng rất ít, nếu có, trong số này sẽ có sẵn (hoặc thực sự có bất kỳ ý nghĩa nào) nếu chạy PHP trên dòng lệnh. 'Php_elf' Tên tệp của tập lệnh hiện đang thực hiện, liên quan đến gốc tài liệu. Chẳng hạn, $ _Server ['php_elf'] trong một tập lệnh tại địa chỉ http://example.com/foo/bar.php sẽ là /foo/bar.php. Hằng số __file__ chứa đường dẫn và tên tệp đầy đủ của tệp hiện tại (tức là bao gồm). Nếu PHP đang chạy như một bộ xử lý dòng lệnh này, biến này chứa tên tập lệnh. 'Argv' mảng các đối số được truyền cho tập lệnh. Khi tập lệnh được chạy trên dòng lệnh, điều này cho phép truy cập kiểu C vào các tham số dòng lệnh. Khi được gọi qua phương thức GET, điều này sẽ chứa chuỗi truy vấn. 'ARGC' chứa số lượng tham số dòng lệnh được truyền vào tập lệnh (nếu chạy trên dòng lệnh). 'Gateway_interface' Bản sửa đổi của đặc tả CGI mà máy chủ đang sử dụng; ví dụ. 'CGI/1.1 '. 'Server_addr' địa chỉ IP của máy chủ theo đó tập lệnh hiện tại đang thực hiện. 'Server_name' Tên của máy chủ máy chủ theo đó tập lệnh hiện tại đang thực thi. Nếu tập lệnh đang chạy trên máy chủ ảo, đây sẽ là giá trị được xác định cho máy chủ ảo đó. The filename of the currently executing script, relative to the document root. For instance, $_SERVER['PHP_SELF'] in a script at the address http://example.com/foo/bar.php would be /foo/bar.php. The
__FILE__ constant contains the full path and filename of the current (i.e. included) file. If PHP is running as a command-line processor this variable contains the script name. 'argv' Array of arguments passed to the script. When the script is run on the command line,
this gives C-style access to the command line parameters. When called via the GET method, this will contain the query string. 'argc' Contains the number of command line parameters passed to the script (if run on the command line). 'GATEWAY_INTERFACE' What revision of the CGI specification the server is using; e.g. 'CGI/1.1 '.
'SERVER_ADDR' The IP address of the server under which the current script is executing. 'SERVER_NAME' The name of the server host under which the current script is executing. If the script is running on a virtual host, this will be the value defined for that virtual host. Chuỗi nhận dạng máy chủ 'server_software', được đưa ra trong các tiêu đề khi trả lời các yêu cầu. Tên 'server_protocol' và sửa đổi giao thức thông tin thông qua đó trang được yêu cầu; ví dụ. '
echo gethostname(); // may output e.g,: sandie 0'; 'Request_method' phương thức yêu cầu nào được sử dụng để truy cập trang; ví dụ. '
echo gethostname(); // may output e.g,: sandie 1', '
echo gethostname(); // may output e.g,: sandie 2', '
echo gethostname(); // may output e.g,: sandie 3', '
echo gethostname(); // may output e.g,: sandie 4'. Server identification string, given in the headers when responding to requests. 'SERVER_PROTOCOL' Name and revision of the information protocol via which the page was requested; e.g. '
echo gethostname(); // may output e.g,: sandie 0'; 'REQUEST_METHOD'
Which request method was used to access the page; e.g. '
echo gethostname(); // may output e.g,: sandie 1', '
echo gethostname(); // may output e.g,: sandie 2', '
echo gethostname(); // may output e.g,: sandie 3', '
echo gethostname(); // may output e.g,: sandie 4'. 'Request_time' dấu thời gian bắt đầu yêu cầu. 'Request_time_float' dấu thời gian bắt đầu yêu cầu, với độ chính xác microsecond. 'Query_String' chuỗi truy vấn, nếu có, thông qua đó trang được truy cập. 'Document_root' thư mục gốc tài liệu theo đó tập lệnh hiện tại đang thực thi, như được định nghĩa trong tệp cấu hình của máy chủ. 'Http_accept' nội dung của tiêu đề
echo gethostname(); // may output e.g,: sandie 6 từ yêu cầu hiện tại, nếu có. 'Http_accept_charset' nội dung của tiêu đề
echo gethostname(); // may output e.g,: sandie 7 từ yêu cầu hiện tại, nếu có. Ví dụ: '
echo gethostname(); // may output e.g,: sandie 8'. 'Http_accept_encoding' nội dung của tiêu đề
echo gethostname(); // may output e.g,: sandie 9 từ yêu cầu hiện tại, nếu có. Ví dụ: '
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
0'. 'Http_accept_langage' nội dung của tiêu đề
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
1 từ yêu cầu hiện tại, nếu có. Ví dụ: '
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
2'. 'HTTP_Connection' nội dung của tiêu đề
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
3 từ yêu cầu hiện tại, nếu có. Ví dụ: '
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
4'. 'Http_host' nội dung của tiêu đề
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
5 từ yêu cầu hiện tại, nếu có. 'Http_referer' địa chỉ của trang (nếu có) giới thiệu tác nhân người dùng đến trang hiện tại. Điều này được đặt bởi tác nhân người dùng. Không phải tất cả các đại lý người dùng sẽ đặt điều này và một số cung cấp khả năng sửa đổi http_referer làm tính năng. Nói tóm lại, nó không thể thực sự được tin tưởng. 'Http_user_agent' nội dung của tiêu đề
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
6 từ yêu cầu hiện tại, nếu có. Đây là một chuỗi biểu thị tác nhân người dùng đang truy cập trang. Một ví dụ điển hình là: mozilla/4.5 [en] (x11; u; linux 2.2.9 i586). Trong số những thứ khác, bạn có thể sử dụng giá trị này với get_browser () để điều chỉnh đầu ra của trang của bạn theo khả năng của tác nhân người dùng. 'HTTPS' được đặt thành giá trị không trống nếu tập lệnh được truy vấn thông qua giao thức HTTPS. 'Remote_addr' địa chỉ IP mà người dùng đang xem trang hiện tại. 'Remote_host' Tên máy chủ mà người dùng đang xem trang hiện tại. Tra cứu DNS ngược dựa trên Remote_addr của người dùng. The timestamp of the start of the request. 'REQUEST_TIME_FLOAT' The timestamp
of the start of the request, with microsecond precision. 'QUERY_STRING' The query string, if any, via which the page was accessed. 'DOCUMENT_ROOT' The document root directory under which the current script is executing, as defined in the server's configuration file. 'HTTP_ACCEPT' Contents of the
echo gethostname(); // may output e.g,: sandie 6 header from the current request, if there is one.
'HTTP_ACCEPT_CHARSET' Contents of the
echo gethostname(); // may output e.g,: sandie 7 header from the current request, if there is one. Example: '
echo gethostname(); // may output e.g,: sandie 8'. 'HTTP_ACCEPT_ENCODING' Contents of the
echo gethostname(); // may output e.g,: sandie 9 header from the current request, if there is one. Example: '
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
0'. 'HTTP_ACCEPT_LANGUAGE' Contents of the
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
1 header from the current request, if there is one. Example: '
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
2'.
'HTTP_CONNECTION' Contents of the
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
3 header from the current request, if there is one. Example: '
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
4'. 'HTTP_HOST' Contents of the
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
5 header from the current request, if there is one. 'HTTP_REFERER' The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide
the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted. 'HTTP_USER_AGENT' Contents of the
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
6 header from the current request, if there is one. This is a string denoting the user agent being which is accessing the page. A typical example is: Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586). Among other things, you can use this value with
get_browser() to tailor your page's output to the capabilities of the user agent. 'HTTPS' Set to a non-empty value if the script was queried through the HTTPS protocol. 'REMOTE_ADDR' The IP address from which the user is viewing the current page. 'REMOTE_HOST' The Host
name from which the user is viewing the current page. The reverse dns lookup is based on the REMOTE_ADDR of the user. 'Remote_port' cổng đang được sử dụng trên máy của người dùng để liên lạc với máy chủ web. 'Remote_user' người dùng được xác thực. 'Redirect_Remote_user' Người dùng được xác thực nếu yêu cầu được chuyển hướng nội bộ. 'Script_filename' The port being used on the user's machine to communicate with the web server. 'REMOTE_USER' The authenticated user. 'REDIRECT_REMOTE_USER' The authenticated user if the request is internally redirected. 'SCRIPT_FILENAME' Tên đường dẫn tuyệt đối của tập lệnh hiện đang thực thi. 'Server_admin' Giá trị được cung cấp cho lệnh server_admin (cho apache) trong tệp cấu hình máy chủ web. Nếu tập lệnh đang chạy trên máy chủ ảo, đây sẽ là giá trị được xác định cho máy chủ ảo đó. 'Server_port' cổng trên máy chủ đang được máy chủ web sử dụng để liên lạc. Đối với các thiết lập mặc định, đây sẽ là '
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
8'; Ví dụ, sử dụng SSL sẽ thay đổi điều này thành bất cứ điều gì mà cổng HTTP an toàn đã xác định của bạn. The value given to the SERVER_ADMIN (for Apache) directive in the web server configuration file. If the script is running on a virtual host, this will be the value defined for that virtual host.
'SERVER_PORT' The port on the server machine being used by the web server for communication. For default setups, this will be '
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using gethostname() behaves differently on different OSes. Linux will return "hostname" while MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with "hostname.local"
8'; using SSL, for instance, will change this to whatever your defined secure HTTP port is. Chuỗi 'server_signature' chứa phiên bản máy chủ và tên máy chủ ảo được thêm vào các trang do máy chủ tạo, nếu được bật. Hệ thống tập tin 'path_translated' (không phải là đường dẫn dựa trên root-) dựa trên tập lệnh hiện tại, sau khi máy chủ đã thực hiện bất kỳ ánh xạ ảo đến thực tế nào. String containing the server version and virtual host name which are added to server-generated pages, if enabled. 'PATH_TRANSLATED' Filesystem- (not document root-) based path to the current script, after the server has done any virtual-to-real mapping. 'Script_name' chứa đường dẫn của tập lệnh hiện tại. Điều này rất hữu ích cho các trang cần phải chỉ vào chính mình. Hằng số __file__ chứa đường dẫn và tên tệp đầy đủ của tệp hiện tại (tức là bao gồm). 'Request_uri' URI được đưa ra để truy cập trang này; Ví dụ, '
To the prev. note: **NEVER USE*** 2'. 'PHP_AUTH_DIGEST' Khi thực hiện xác thực HTTP Digest HTTP này được đặt thành tiêu đề 'ủy quyền' được gửi bởi máy khách (sau đó bạn nên sử dụng để thực hiện xác thực phù hợp). 'PHP_AUTH_USER' Khi thực hiện xác thực HTTP, biến này được đặt thành tên người dùng do người dùng cung cấp. 'PHP_AUTH_PW' Khi thực hiện xác thực HTTP, biến này được đặt thành mật khẩu do người dùng cung cấp. 'Auth_Type' Khi thực hiện xác thực HTTP Biến này được đặt thành loại xác thực. 'PATH_INFO' chứa bất kỳ thông tin đường dẫn do khách hàng cung cấp theo tên tệp tập lệnh thực tế nhưng trước chuỗi truy vấn, nếu có. Chẳng hạn, nếu tập lệnh hiện tại được truy cập thông qua URL http://www.example.com/php/path_info.php/some/stuff?foo=bar, thì $ _server ['path_info'] sẽ chứa
To the prev. note: **NEVER USE*** 3. 'Orig_path_info' phiên bản gốc của 'path_info' trước khi được xử lý bởi PHP. Contains the current script's path. This is useful for pages which need to point to themselves. The __FILE__ constant contains the full path and filename of the current (i.e. included) file. 'REQUEST_URI'
The URI which was given in order to access this page; for instance, '
To the prev. note: **NEVER USE*** 2'. 'PHP_AUTH_DIGEST' When doing Digest HTTP authentication this variable is set to the 'Authorization' header sent by the client (which you should then use to make the appropriate validation). 'PHP_AUTH_USER' When doing HTTP authentication this variable is set to the username provided by the user.
'PHP_AUTH_PW' When doing HTTP authentication this variable is set to the password provided by the user. 'AUTH_TYPE' When doing HTTP authentication this variable is set to the authentication type. 'PATH_INFO' Contains any client-provided pathname information trailing the actual script filename but preceding the query string, if available. For instance, if the current script was
accessed via the URL http://www.example.com/php/path_info.php/some/stuff?foo=bar, then $_SERVER['PATH_INFO'] would contain
To the prev. note: **NEVER USE*** 3. 'ORIG_PATH_INFO' Original version of 'PATH_INFO' before processed by PHP. Ví dụVí dụ #1 $ _Server Ví dụ
Ví dụ trên sẽ xuất ra một cái gì đó tương tự như: Ghi chú
'Server_admin' Giá trị được cung cấp cho lệnh server_admin (cho apache) trong tệp cấu hình máy chủ web. Nếu tập lệnh đang chạy trên máy chủ ảo, đây sẽ là giá trị được xác định cho máy chủ ảo đó. 'Server_port' cổng trên máy chủ đang được máy chủ web sử dụng để liên lạc. Đối với các thiết lập mặc định, đây sẽ là ' Lưu ý: Theo Apache 2, bạn phải đặt
Chuỗi 'server_signature' chứa phiên bản máy chủ và tên máy chủ ảo được thêm vào các trang do máy chủ tạo, nếu được bật. Hệ thống tập tin 'path_translated' (không phải là đường dẫn dựa trên root-) dựa trên tập lệnh hiện tại, sau khi máy chủ đã thực hiện bất kỳ ánh xạ ảo đến thực tế nào. ¶ Lưu ý: Người dùng Apache 2 có thể sử dụng
'Script_name' chứa đường dẫn của tập lệnh hiện tại. Điều này rất hữu ích cho các trang cần phải chỉ vào chính mình. Hằng số __file__ chứa đường dẫn và tên tệp đầy đủ của tệp hiện tại (tức là bao gồm). 'Request_uri' URI được đưa ra để truy cập trang này; Ví dụ, ' Ví dụ
Ví dụ #1 $ _Server Ví dụ ¶ Lưu ý: Theo Apache 2, bạn phải đặt
Chuỗi 'server_signature' chứa phiên bản máy chủ và tên máy chủ ảo được thêm vào các trang do máy chủ tạo, nếu được bật. Hệ thống tập tin 'path_translated' (không phải là đường dẫn dựa trên root-) dựa trên tập lệnh hiện tại, sau khi máy chủ đã thực hiện bất kỳ ánh xạ ảo đến thực tế nào. ¶ Lưu ý: Người dùng Apache 2 có thể sử dụng
'Script_name' chứa đường dẫn của tập lệnh hiện tại. Điều này rất hữu ích cho các trang cần phải chỉ vào chính mình. Hằng số __file__ chứa đường dẫn và tên tệp đầy đủ của tệp hiện tại (tức là bao gồm). 'Request_uri' URI được đưa ra để truy cập trang này; Ví dụ, ' Ví dụ
Ví dụ #1 $ _Server Ví dụ ¶ Ví dụ
Ví dụ #1 $ _Server Ví dụ ¶ Lưu ý: Theo Apache 2, bạn phải đặt
Ví dụ #1 $ _Server Ví dụ ¶ Ví dụ
Ví dụ #1 $ _Server Ví dụ ¶ Ví dụ trên sẽ xuất ra một cái gì đó tương tự như:
Ghi chú ¶ Đây là một 'Superglobal', hoặc biến toàn cầu, tự động. Điều này đơn giản có nghĩa là nó có sẵn trong tất cả các phạm vi trong suốt một kịch bản. Không cần phải thực hiện biến $ toàn cầu; để truy cập nó trong các chức năng hoặc phương pháp.
Vladimir Kornea ¶ ¶ 13 năm trước
Vcoletti tại Tiscali Dot it ¶ ¶ Ví dụ
Steve tại Sc-Fa Dot Com ¶ ¶ 13 năm trước
Mark Simon ¶ ¶ 3 năm trước
Richard York ¶ ¶ 13 năm trước
Mark Simon ¶ ¶ 3 năm trước
Richard York ¶ ¶ Stefano (Thông tin tại Sarchittu Dot Org) ¶
11 năm trước ¶ Danieltahar ¶
2 năm trước ¶ Chris at Ocproducts Dot Com ¶
5 năm trước ¶ 3 năm trước
Richard York ¶ ¶ 13 năm trước
Stefano (Thông tin tại Sarchittu Dot Org) ¶ ¶ 13 năm trước
11 năm trước ¶ Danieltahar ¶
2 năm trước ¶ Danieltahar ¶
2 năm trước ¶ 13 năm trước
Chris at Ocproducts Dot Com ¶ ¶ 5 năm trước
Tom ¶ ¶ 3 năm trước
Richard York ¶ ¶ Stefano (Thông tin tại Sarchittu Dot Org) ¶
11 năm trước ¶ 13 năm trước
Danieltahar ¶ ¶ 13 năm trước
2 năm trước ¶ 5 năm trước
Tom ¶ ¶ 10 năm trước
picov tại e-link dot nó ¶ ¶ Stefano (Thông tin tại Sarchittu Dot Org) ¶
11 năm trước ¶ Danieltahar ¶
echo gethostname(); // may output e.g,: sandie 792 năm trước ¶ 13 năm trước
Làm cách nào để tìm tên máy chủ của tôi trong PHP?Hàm gethostName () trả về tên máy chủ cho máy cục bộ.gethostname() function returns the host name for the local machine.
$ _ Máy chủ http_host là gì?$ _Server ['http_host'] trả về tiêu đề máy chủ từ yêu cầu hiện tại.$ _Server ['http_referer'] trả về URL hoàn chỉnh của trang hiện tại (không đáng tin cậy vì không phải tất cả các tác nhân người dùng đều hỗ trợ nó)Returns the Host header from the current request. $_SERVER['HTTP_REFERER'] Returns the complete URL of the current page (not reliable because not all user-agents support it)
Làm cách nào để tìm tên máy chủ Linux của tôi?Tìm tên máy tính trên Linux.. Mở một thiết bị đầu cuối.Để mở một thiết bị đầu cuối trong Ubuntu, chọn các ứng dụng -> Phụ kiện -> Terminal .. Nhập tên máy chủ tại dòng lệnh.Điều này sẽ in tên máy tính của bạn trên dòng tiếp theo .. Làm cách nào để khởi động một máy chủ PHP cục bộ?Trong phần này, chúng tôi sẽ trải qua một vài lệnh đơn giản cho máy chủ web PHP ... Bắt đầu một máy chủ PHP -S localhost: 8000..... Chỉ định một tài liệu thư mục gốc PHP -S localhost: 8000 -t foo/ .... Sử dụng tệp bộ định tuyến PHP -S LocalHost: 8000 Bộ định tuyến..... Bước 1: Tải xuống Pchart Curl -Lok http://www.pchart.net/release/pchart2.1.4.tar .. |