Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the problems in building PHP Douyin SDK?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

PHP Douyin SDK building problems, I believe that many inexperienced people do not know what to do, so this article summarizes the causes and solutions, through this article I hope you can solve this problem.

1. [0] cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) error

The error is due to the verification of the SSL certificate.

Solution 1:

You just need to put

$apiInstance = new DefaultApi (new Client ())

Change to

$apiInstance = new DefaultApi (new Client (['verify'= > false]))

OK, mainly modify new Client () here, other API is the same

Solution 2:

Download a ca-bundle.crt, put it in the corresponding directory, and configure the path in the php.ini file.

Https://github.com/bagder/ca-bundle/blob/e9175fec5d0c4d42de24ed6d84a06d504d5e5a09/ca-bundle.crt is added at the end of php.ini, and curl.cainfo= "real path / ca-bundle.crt" restarts the web server.

II. Invalid prompt configuration

Call the authorization login API

Https://open.douyin.com/platform/oauth/connect?client_key=xxx&response_type=code&scope=user_info&redirect_uri=redirect_uri&state=1

Prompt authorization failure or configuration failure

The application for the cause of the problem is the mobile application. The actual call scans the web for the web application. The web application has an authorized domain callback configuration when applying, that is, fill in the callback domain name.

For the solution to re-apply for web application, you need to fill in this callback address

3. Get the user's information report Invalid value for'ewriting tweets'

Must be one of 'EAccountM',' EAccountS', 'EAccountK'

The error occurred when calling the oauthUserinfoGetWithHttpInfo interface of UserInfoApi

Cause of the problem

Since the e_account_role field in the returned user information is caused by null, it can be solved by modifying API. This error is generally caused by abnormal calls to API, such as the use of client_key of mobile applications to force authorization of web applications.

Solution

Since the e_account_role field in the returned user information is caused by null, it can be solved by modifying API.

According to the error prompt of TP, we can send a message that the error occurred in Douyin\ Open\ Model\ OauthUserinfoResponseData.php line 564.

The error occurred on line 564

Comment out lines 563-570 to get normal user information.

Before modification:

After modification:

After reading the above, have you mastered the methods of building PHP Douyin SDK? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report