无法在IIS上运行QuickBooks在线php devkit



我已经通过本地IIS服务器上的git克隆了QuickBooks php devkit。

根据此处提到的步骤,在docspartner_platformexample_app_ipp_v3config.php文件中更新了几个变量:QuickBooks Online Quick Start

$token = '505851e5b393db43d5b8fd6b5c67cc3584c0';
$oauth_consumer_key = 'qyprdc1Q7grOuaQzN8Y3fxq6RxRfsI';
$oauth_consumer_secret = 'o4JTZVLndeBpp5iqFNj19ysJf0NW0t9QCAh6iIJ6';
$quickbooks_oauth_url = 'http://localhost/quickbooks-php/docs/partner_platform/example_app_ipp_v3/oauth.php';
$quickbooks_success_url = 'http://localhost/quickbooks-php/docs/partner_platform/example_app_ipp_v3/success.php';
$quickbooks_menu_url = 'http://localhost/quickbooks-php/docs/partner_platform/example_app_ipp_v3/menu.php';
$dsn = 'mysqli://root:sa123@192.168.1.3:3306/test'; // same connection works for another application

此示例在Mac上的Apache Server上工作。但是它在Windows上给出了此错误:http://prnt.sc/eccdc3

当我尝试从Apache(Mac)到IIS(Windows)运行工作代码时,它也会给出一些奇怪的错误,该代码在此堆栈溢出问题的第3期中提到:无法添加税收刷气,从/转到QuickBooks多个ShipAddr在线使用QuickBooks php devkit

您的curl php扩展名似乎是错误的。如果您注意到,当您尝试使用卷发访问TLS/SSL网站时,您会得到类似的内容:

Trying to hit URL: https://oauth.intuit.com/oauth/v1/get_request_token
   Did we disable SSL checks? false
* Hostname oauth.intuit.com was found in DNS cache
*   Trying 173.240.170.25...
* TCP_NODELAY set
* Connected to oauth.intuit.com (173.240.170.25) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* SSL certificate problem: self signed certificate in certificate chain
* Curl_http_done: called premature == 1
* Closing connection 0

请注意,在交换任何实际数据之前,连接立即关闭。

将TLS/SSL验证明确禁用时的结果进行比较:

Trying to hit URL: https://oauth.intuit.com/oauth/v1/get_request_token
   Did we disable SSL checks? true
* Hostname oauth.intuit.com was found in DNS cache
*   Trying 173.240.170.25...
* TCP_NODELAY set
* Connected to oauth.intuit.com (173.240.170.25) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* SSL connection using TLSv1.2 / AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: C=US; ST=California; L=San Diego; O=INTUIT INC.; OU=CTO-DEV-ICS-OAuth1; CN=oauth.intuit.net
*  start date: Sep  9 00:00:00 2016 GMT
*  expire date: Sep 10 23:59:59 2019 GMT
*  issuer: C=US; O=Symantec Corporation; OU=Symantec Trust Network; CN=Symantec Class 3 Secure Server CA - G4
*  SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.
> GET /oauth/v1/get_request_token HTTP/1.1
Host: oauth.intuit.com
Accept: */*
< HTTP/1.1 400 Bad Request
< Content-Type: text/plain
< Content-Length: 70
< Connection: keep-alive
< Date: Tue, 28 Mar 2017 02:34:14 GMT
< Server: Apache
< WWW-Authenticate: OAuth oauth_parameters_absent="oauth_signature", oauth_problem="parameter_absent"
< Cache-Control: no-cache, no-store
< Pragma: no-cache
< 
* Curl_http_done: called premature == 0
* Connection #0 to host oauth.intuit.com left intact

oauth_problem=parameter_absent&oauth_parameters_absent=oauth_signature

请注意,它现在有效。

这告诉我,这里可能的问题是您的卷曲PHP扩展不知道如何提出TLS请求。这是卷曲和PHP的一个普遍问题。

如果您搜索Google或Stackoverflow以找到类似的内容:

  • " php curl不与https一起使用"

您会发现很多答案,解释了如何处理此问题,以及有关信托商店和CAS的官方卷发陈述:

  • https://curl.haxx.se/docs/sslcerts.html

还请查看并确认此PHP卷发配置变量的正确配置:

  • curl.cainfo

参考以下内容:

  • http://php.net/manual/en/curl.configuration.php

最新更新