How to $POST variables to php-fpm with nginx

Steve Holdoway steve at greengecko.co.nz
Mon Feb 23 04:01:45 UTC 2015


curl is the simplest...

        $Request = curl_init();
        curl_setopt ( $Request, CURLOPT_URL, "http://api.example.com" );
        curl_setopt ( $Request, CURLOPT_ENCODING, 'gzip' );
        curl_setopt ( $Request, CURLOPT_RETURNTRANSFER, true );
        curl_setopt ( $Request, CURLOPT_POST, true );

	$options ["var1"] = "value";
	...

        curl_setopt ( $Request, CURLOPT_POSTFIELDS, $options );
        $Result =  curl_exec   ( $Request );
        curl_close  ( $Request );

Should be an ( untested ! ) starting point.

Steve


On Fri, 2015-02-20 at 22:31 -0800, David Benfell wrote:
> Hi all,
> 
> In one of my sites, sks.disunitedstates.com, I have a single index
> page--index.html--which has a number of forms, one of which calls a
> php script named server-lookup.php. It means to pass a $POST variable
> to this script but instead, I get "No input file specified."
> Obviously, the variable isn't getting passed.
> 
> I saw the answer at
> http://serverfault.com/questions/231578/nginx-php-fpm-where-are-my-get-params
> 
> It doesn't work with this situation; I still get the same error.
> 
> Thanks!
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

-- 
Steve Holdoway BSc(Hons) MIITP
http://www.greengecko.co.nz
Linkedin: http://www.linkedin.com/in/steveholdoway
Skype: sholdowa



More information about the nginx mailing list