Closed oleg-andreyev closed 2 years ago
Of course, because your HOST var is wrong. the Hostname is always without the PORT.
Try:
$this->hive['HOST'] = 'localhost'
$this->hive['PORT'] = '8000'
@ikkez HOST is filled from $_SERVER variable, SERVER_NAME, it's not manually configured.
Which web server are you running?
this looks related https://serverfault.com/questions/924323/serverserver-name-returns-nginx-reverse-proxy-port-name https://serverfault.com/questions/493055/port-number-being-added-to-wordpress-admin-after-varnish-install?rq=1 so perhaps a nginx config thingy
Well using Symfony CLI (symfony serve) command :) it's starting local server with php-fpm
So could it be related to https://github.com/bcosca/fatfree/issues/1246? Although I couldn't reproduce the issue...
Looks like there're rare occasions where $_SERVER['SERVER_NAME'] includes a port number.. that would indeed be an issue, but I would say it's more likely a server config problem. The port should not be included here.
I wasn't able to reproduce either.
So could it be related to https://github.com/bcosca/fatfree/issues/1246?
Although I couldn't reproduce the issue...
Yes and it's not a bug 🐞
From php.net: '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.
From CGI specs: The SERVER_NAME variable MUST be set to the name of the server host to which the client request is directed. It is a case-insensitive hostname or network address. It forms the host part of the Script-URI.
So we can close this issue?
@ikkez don't get me wrong, but I think issue should be fixed. I've provided CGI specs that says SERVER_NAME may have port number.
4.1.14. SERVER_NAME
The SERVER_NAME variable MUST be set to the name of the server host to which the client request is directed. It is a case-insensitive hostname or network address. It forms the host part of the Script-URI.
SERVER_NAME = server-name server-name = hostname | ipv4-address | ( "[" ipv6-address "]" )
A deployed server can have more than one possible value for this variable, where several HTTP virtual hosts share the same IP address. In that case, the server would use the contents of the request's Host header field to select the correct virtual host.
4.1.15. SERVER_PORT
The SERVER_PORT variable MUST be set to the TCP/IP port number on which this request is received from the client. This value is used in the port part of the Script-URI.
SERVER_PORT = server-port server-port = 1*digit
Well, to me this looks like SERVER_NAME is name only, hence SERVER_PORT is mandatory to be set. What's new to me is that it can contain multiple host names 🤔
What's new to me is that it can contain multiple host names
I don't read it like this. It rather looks like a warning about web servers hosting multiple host names (which is very common). In any case, the variable contains only one host name at at time.
Well, to me this looks like SERVER_NAME is name only
I read a bit differently, "network address" must have a port number. Example:
are different network addresses, while host/ip is the same.
Running 3F locally on port 8000 Using
xfra35/f3-multilang
as result of
\Base::reroute
framework is trying to redirect me tohttp://localhost:8000:8000/en