We help IT Professionals succeed at work.
Get Started

$_SERVER["HTTP_CLIENT_IP"] causes error in FastCGI mode

Kyanzes
Kyanzes asked
on
2,946 Views
Last Modified: 2012-05-09
So, I have a piece of code that worked perfectly up until now, that is, under ISAPI mode.

Now I have installed PHP in FastCGI and the following code no longer works:

$cip = $_SERVER["HTTP_CLIENT_IP"] ;

The PHP version is 5.2.9-2 for both installations (the old ISAPI and the current FastCGI).

The error thrown:

Client found response content type of '', but expected 'text/xml'. The request failed with the error message: -- PHP Warning: Call-time pass-by-reference has been deprecated in C:\inetpub\wwwroot\TEST\WS\wsdatahandler.php on line 781 PHP Warning: Call-time pass-by-reference has been deprecated in C:\inetpub\wwwroot\TEST\WS\wsdatahandler.php on line 781 PHP Warning: Call-time pass-by-reference has been deprecated in C:\inetpub\wwwroot\TEST\WS\wsdatahandler.php on line 894 PHP Warning: Call-time pass-by-reference has been deprecated in C:\inetpub\wwwroot\TEST\WS\wsdatahandler.php on line 897 PHP Warning: Call-time pass-by-reference has been deprecated in C:\inetpub\wwwroot\TEST\WS\wsdatahandler.php on line 897 PHP Notice: Undefined index: HTTP_CLIENT_IP in C:\inetpub\wwwroot\TEST\WS\wshandler.php on line 225 PHP Notice: Undefined index: HTTP_X_FORWARDED_FOR in C:\inetpub\wwwroot\TEST\WS\wshandler.php on line 225 --.

PHP version is unchanged, IIS is unchanged.

What could be the root of the problem???

Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE