NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
REMOTE_ADDRESS issue


Joined: 03 May 2014
Posts: 3
Reply with quote
I'm trying to run cs-cart in phpED using SRV Local Server and it fails when trying to validate the IP address.
The SERVER REMOTE_ADDRESS is set to 0:0:0:0:0:0:0:1

Is this something that that can be managed in phpED?
View user's profileFind all posts by gmckaySend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
Not sure if NuSphere will agree, but my suggestion would probably be to not use SRV.

Whilst SRV has its uses, particularly for testing CLI PHP scripts which do not normally run in a web server context, SRV is not a web server and some things do not work like they do on a web server. Maybe REMOTE_ADDRESS is one of those things?

Using full Apache (my personal preference) or IIS with PHP would possibly be best.
View user's profileFind all posts by plugnplaySend private message


Joined: 03 May 2014
Posts: 3
Reply with quote
I have XAMPP but I found it difficult to debug CubeCart administrator functions with Apache, it works well with SRV.

I'll give it a go with Apache and post the results...
View user's profileFind all posts by gmckaySend private message
Re: REMOTE_ADDRESS issue
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
gmckay wrote:
I'm trying to run cs-cart in phpED using SRV Local Server and it fails when trying to validate the IP address.
The SERVER REMOTE_ADDRESS is set to 0:0:0:0:0:0:0:1
Is this something that that can be managed in phpED?


Could you please clarify what fails and when? This is an ipv6 representation for loopback address. Another way to type the same is ::1

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 03 May 2014
Posts: 3
Reply with quote
When I run under Apache REMOTE_SERVER contains 127.0.1.1, this is a valid IP.

CS-Cart tries to use gethostbyaddr($ip['host']) where host contains the value in REMOTE_SERVER. Using SVR this causes a failure. I'd don't know enough about the SVR setup to be able to set this to a valid IP.
View user's profileFind all posts by gmckaySend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
0:0:0:0:0:0:0:1 is a valid IP address too, it's just IPv6 unlike 127.0.0.1 which is IPv4.
It's completely up to the browser to use IPv6 or IPv4 protocol.
SRV accepts connection from the browsers on both protocols and passes connection info to php. If your CS-Cart can't work with IPv6, you better file an issue to maintainers and switch to IPv4 in your browser (URL) until they have a fix. I think http://127.0.0.1/ will do.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
REMOTE_ADDRESS issue
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic