artfulrobot / uk.artfulrobot.civicrm.gocardless

A CiviCRM extension providing GoCardless integration to handle UK Direct Debits.
GNU Affero General Public License v3.0
5 stars 18 forks source link

Nginx support #23

Closed jamienovick closed 6 years ago

jamienovick commented 7 years ago

Hey Rich,

We are getting the following:

"PHP message: PHP Fatal error: Call to undefined function getallheaders() in /var/www/..../httpdocs/sites/all/civicrm_extensions/uk.artfulrobot.civicrm.gocardless/CRM/GoCardless/Page/Webhook.php on line 31" while reading response header from upstream, client: , server: , request: "GET /civicrm/gocardless/webhook HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: " "

Issue is from: Call to undefined function getallheaders() This appears to be a known nginx+php-fpm problem: http://www.rawnet.com/labs/authorization-headers-in-php-using-fpm https://stackoverflow.com/questions/13224615/get-the-http-headers-from-current-request-in-php https://stackoverflow.com/questions/41427359/phpunit-getallheaders-not-work/41428728 https://www.popmartian.com/tipsntricks/2015/07/14/howto-use-php-getallheaders-under-fastcgi-php-fpm-nginx-etc/

Are you able to use a different method to be NGINX compatible?

Best

Jamie

artfulrobot commented 7 years ago

What version of PHP are you running?

jamienovick commented 7 years ago

Hi Rich, thanks for getting back to us. It's:

5.6.30-1+deb.sury.org~trusty+1

best

Jamie

artfulrobot commented 7 years ago

Are you able to apply this patch and test it? I've not created a release .zip file for this yet, let me know if that's a problem.

mattlinduk commented 7 years ago

Hi Rich,

Unfortunately, that doesn't seem to have solved the issue - we're still getting the same error although the line is changed:

2017/09/06 13:38:20 [error] 4687#0: *18702 FastCGI sent in stderr: "PHP message: PHP Fatal error: Call to undefined function getallheaders() in /var/www/[...]/httpdocs/sites/all/civicrm_extensions/uk.artfulrobot.civicrm.gocardless/CRM/GoCardless/Page/Webhook.php on line 32" while reading response header from upstream, client: , server: , request: "GET /civicrm/gocardless/webhook HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "", referrer: ""

Is there something we can do on this end to give you more info?

Best regards,

Matt

artfulrobot commented 7 years ago

Check line 32 on your copy of the code.

If you have checked out the updated file you'll see there is no code on line 32 - just a comment! https://github.com/artfulrobot/uk.artfulrobot.civicrm.gocardless/blob/master/CRM/GoCardless/Page/Webhook.php#L32 which suggests you still have a different version?

You can download just that file here.

Can you double check?

mattlinduk commented 7 years ago

Will check and get back to you, Rich! Thanks.

artfulrobot commented 6 years ago

bump :-)

jamienovick commented 6 years ago

Sorry Rich, I'll follow up on this. @artfulrobot

artfulrobot commented 6 years ago

Any news, @jamienovick ?

MailinhVu1 commented 6 years ago

Hi Rich, Sorry we were a bit held up with the progress of this, but we are back on track and are currently testing it!

Will get back to you as soon as I can.

All the best ML

MailinhVu1 commented 6 years ago

Hi Rich, all seems to work fine :)

Thanks Mai-Linh

artfulrobot commented 6 years ago

Great!