aggcat php示例不起作用 [英] aggcat php sample is not working
问题描述
我正在使用以下配置: Apache/2.2.22(Win32)PHP/5.4.17
I'm using the following configuration: Apache/2.2.22 (Win32) PHP/5.4.17
执行php示例时,我收到以下错误消息:
When performing php sample I recieve the following error messages:
注意:未定义的偏移量:199行中的C:\ Program Files(x86)\ Apache Software Foundation \ Apache2.2 \ htdocs \ Intuit_Original \ class.aggcatauth.php中的1 $ ResponseKVPairs [$ OneKVPair [0]] = $ OneKVPair [1];
Notice: Undefined offset: 1 in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit_Original\class.aggcatauth.php on line 199 $ResponseKVPairs[$OneKVPair[0]] = $OneKVPair[1];
通知:未定义索引:C:\ Program Files(x86)\ Apache Software Foundation \ Apache2.2 \ htdocs \ Intuit_Original \ class.aggcatauth.php中的oauth_token $ oauth_token = $ ResponseKVPairs ['oauth_token'];
Notice: Undefined index: oauth_token in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit_Original\class.aggcatauth.php on line 202 $oauth_token = $ResponseKVPairs['oauth_token'];
通知:未定义索引:C:\ Program Files(x86)\ Apache Software Foundation \ Apache2.2 \ htdocs \ Intuit_Original \ class.aggcatauth.php中的oauth_token_secret $ oauth_token_secret = $ ResponseKVPairs ['oauth_token_secret'];
Notice: Undefined index: oauth_token_secret in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit_Original\class.aggcatauth.php on line 203 $oauth_token_secret = $ResponseKVPairs['oauth_token_secret'];
警告:在第65行的C:\ Program Files(x86)\ Apache Software Foundation \ Apache2.2 \ htdocs \ Intuit_Original \ example.php中为foreach()提供了无效的参数 foreach($ xmlObj为$ OneInstitution)
Warning: Invalid argument supplied for foreach() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit_Original\example.php on line 65 foreach($xmlObj as $OneInstitution)
我认为原因是从 https://oauth.intuit.com/oauth/v1/get_access_token_by_saml
I assume the reason is empty tokens recieved (I checked this) from https://oauth.intuit.com/oauth/v1/get_access_token_by_saml
我的Config.php:
My Config.php:
<?php
define('SIMPLESAML_PATH', 'C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/phplibs/simplesamlphp-1.11.0');
define('SIMPLEOAUTH_PATH', 'C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/phplibs');
define('OAUTH_CONSUMER_KEY', 'qyprdM8VUKLwmWSytg83gPmnRSGLWJ');
define('OAUTH_SHARED_SECRET', 'yWdb7SHKubxEKxxFnkliGfDAKnehuwh9fkRmfAYk');
define('SAML_IDENTITY_PROVIDER_ID', 'accountingsuite.12359.cc.dev-intuit.ipp.prod');
define('SAML_X509_CERT_PATH', 'C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit keys\intuit.crt');
define('SAML_X509_PRIVATE_KEY_PATH', 'C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit keys\intuit.key');
define('SAML_NAME_ID', '001'); // Up to you; just "keep track" of what you use
define('OAUTH_SAML_URL', 'https://oauth.intuit.com/oauth/v1/get_access_token_by_saml');
define('FINANCIAL_FEED_HOST', 'financialdatafeed.platform.intuit.com');
define('FINANCIAL_FEED_URL', 'https://'.FINANCIAL_FEED_HOST.'/');
require_once(SIMPLESAML_PATH . "/lib/xmlseclibs.php");
require_once(SIMPLESAML_PATH . "/lib/SimpleSAML/Utilities.php");
require_once(SIMPLEOAUTH_PATH . "/OAuthSimple.php");
提供的键非常适合C#示例. (但我使用了p12文件).
Keys provided work great with C# example. (But I used p12 file).
那么为什么它不起作用?期待您的回答.
So why it's not working? Looking forward for your answer.
推荐答案
我无法正常启动并运行PHP示例应用程序.经过调试后,以下是我必须更改才能使其正常工作的地方:
I had trouble getting the PHP sample app up and working originally. After some debugging, here are the things I had to change to get it working:
•OAuthSimple.php文件不是我按照 phpaggcat示例.我在这里找到OAuthSimple.php文件: OAuthSimple.php下载.
• The OAuthSimple.php file was not part of the SimpleSAML package that I downloaded as instructed in the phpaggcat example. I found the OAuthSimple.php file here: OAuthSimple.php download.
•curl_setopt($ ch,CURLOPT_SSL_VERIFYPEER,false);//在class.aggcatauth.php中从true更改为false
• curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Changed from true to false in class.aggcatauth.php
•curl_setopt($ ch,CURLOPT_SSL_VERIFYPEER,false);//在example.php curl选项中添加了这一行
• curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Added this line in example.php curl options
•set_time_limit(120);//在example.php的开头添加了此内容,因为银行下载所花费的时间超过了默认值30秒
• set_time_limit(120); // Added this at beginning of example.php because bank downloads were taking longer than the default of 30 seconds
•在php.ini中更改了max_input_vars = 2500
• changed max_input_vars = 2500 in php.ini
进行了这些更改之后,我就可以连接到API并使其正常工作.
Once I made those changes, I was able to connect with the API and get it working.
这篇关于aggcat php示例不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!