Linkedin PHP登录API调用

Linkedin PHP登录API调用,php,login,linkedin,linkedin-api,Php,Login,Linkedin,Linkedin Api,我正在使用Github上的类(Happyr\Linkedin)连接到Linkedin API并创建登录名。它工作得很好,没有任何问题,直到它不再工作,但没有做任何改变 这是我的电话号码: $linkedIn=new Happyr\LinkedIn\LinkedIn('apikey', 'apisecret'); 会话_start() 我收到的是其中一个供应商包中的异常: Fatal error: Uncaught Http\Client\Exception\NetworkException:

我正在使用Github上的类(Happyr\Linkedin)连接到Linkedin API并创建登录名。它工作得很好,没有任何问题,直到它不再工作,但没有做任何改变

这是我的电话号码:

$linkedIn=new Happyr\LinkedIn\LinkedIn('apikey', 'apisecret');
会话_start()

我收到的是其中一个供应商包中的异常:

Fatal error: Uncaught Http\Client\Exception\NetworkException: Could not resolve host: www.linkedin.com in /var/www/html/vendor/php-http/curl-client/src/Client.php:134 Stack trace: 
#0 /var/www/html/vendor/happyr/linkedin-api-client/src/Http/RequestManager.php(37): Http\Client\Curl\Client->sendRequest(Object(GuzzleHttp\Psr7\Request))
#1 /var/www/html/vendor/happyr/linkedin-api-client/src/Authenticator.php(124): Happyr\LinkedIn\Http\RequestManager->sendRequest('POST', 'https://www.lin...', Array, 'grant_type=auth...')
#2 /var/www/html/vendor/happyr/linkedin-api-client/src/Authenticator.php(76): Happyr\LinkedIn\Authenticator->getAccessTokenFromCode(Object(Happyr\LinkedIn\Http\UrlGenerator), 'AQTWSqlSdfv3Fy_...')
#3 /var/www/html/vendor/happyr/linkedin-api-client/src/LinkedIn.php(293): Happyr\LinkedIn\Authenticator->fetchNewAccessToken(Object(Happyr\LinkedIn\Http\UrlGenerator))
#4 /var/www/html/vendor/happyr/linkedin-api-client/src/LinkedIn.php(95): Happyr\LinkedIn\LinkedIn->getAccessToken()
#5 /var/www/html/index.php(9): Happ in /var/www/html/vendor/happyr/linkedin-api-client/src/Authenticator.php on line 128

您知道如何解决此问题吗?

请更新composer.lock文件,然后重试。

您的网络配置似乎有问题。无论出于何种原因,脚本都无法找到主机
www.linkedin.com
@E_p I从服务器ping linkedin,看起来一切正常。网络配置中可能出现什么错误?唯一的活动是数字海洋水滴关闭了几个小时,由于付款,DO工作人员关闭了它。当液滴关闭时是否会发生影响网络配置的情况?首先,可能是代理和防火墙。您还需要查看php配置,一些功能/模块可以关闭。您还可以尝试将
CURLOPT\u DNS\u USE\u GLOBAL\u CACHE=>false
CURLOPT\u DNS\u CACHE\u TIMEOUT=>2
作为curl选项的一部分,这听起来更像是一个注释。
Fatal error: Uncaught Http\Client\Exception\NetworkException: Could not resolve host: www.linkedin.com in /var/www/html/vendor/php-http/curl-client/src/Client.php:134 Stack trace: 
#0 /var/www/html/vendor/happyr/linkedin-api-client/src/Http/RequestManager.php(37): Http\Client\Curl\Client->sendRequest(Object(GuzzleHttp\Psr7\Request))
#1 /var/www/html/vendor/happyr/linkedin-api-client/src/Authenticator.php(124): Happyr\LinkedIn\Http\RequestManager->sendRequest('POST', 'https://www.lin...', Array, 'grant_type=auth...')
#2 /var/www/html/vendor/happyr/linkedin-api-client/src/Authenticator.php(76): Happyr\LinkedIn\Authenticator->getAccessTokenFromCode(Object(Happyr\LinkedIn\Http\UrlGenerator), 'AQTWSqlSdfv3Fy_...')
#3 /var/www/html/vendor/happyr/linkedin-api-client/src/LinkedIn.php(293): Happyr\LinkedIn\Authenticator->fetchNewAccessToken(Object(Happyr\LinkedIn\Http\UrlGenerator))
#4 /var/www/html/vendor/happyr/linkedin-api-client/src/LinkedIn.php(95): Happyr\LinkedIn\LinkedIn->getAccessToken()
#5 /var/www/html/index.php(9): Happ in /var/www/html/vendor/happyr/linkedin-api-client/src/Authenticator.php on line 128