溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

wordpress怎么實(shí)現(xiàn)QQ微信釘釘Github手機(jī)號(hào)登陸

發(fā)布時(shí)間:2021-09-14 16:09:38 來源:億速云 閱讀:132 作者:小新 欄目:建站服務(wù)器

這篇文章主要介紹wordpress怎么實(shí)現(xiàn)QQ微信釘釘Github手機(jī)號(hào)登陸,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!

wordpress版本:wordpress:4.9.8版本
php版本:v7.2.12
dockcer鏡像為:wordpress:4.9.8

圖形驗(yàn)證碼加載不出來

最近利用wordpress建站的時(shí)候,用到了wechat-social-login插件實(shí)現(xiàn)微信、QQ、釘釘、Github登陸功能時(shí),開啟圖形驗(yàn)證碼功能后,看到圖形二維碼一直加載不出來,F12看到狀態(tài)碼為200,但沒有返回值,報(bào)錯(cuò)This request has no response data available

wordpress怎么實(shí)現(xiàn)QQ微信釘釘Github手機(jī)號(hào)登陸

wordpress怎么實(shí)現(xiàn)QQ微信釘釘Github手機(jī)號(hào)登陸
打開wordpress日志后,發(fā)現(xiàn)debug日志文件中報(bào)以下的錯(cuò)誤。開啟debug日志方法請(qǐng)移步歷史文章如何開啟WordPress調(diào)試模式(報(bào)錯(cuò)提示),將日志打印到wp-content目錄下的debug.log中。
wordpress怎么實(shí)現(xiàn)QQ微信釘釘Github手機(jī)號(hào)登陸

[08-Feb-2020 07:37:42 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function Gregwar\Captcha\imagettfbbox() in /var/www/html/wp-content/plugins/wechat-social-login/includes/captcha/CaptchaBuilder.php:327
Stack trace:
#0 /var/www/html/wp-content/plugins/wechat-social-login/includes/captcha/CaptchaBuilder.php(440): Gregwar\Captcha\CaptchaBuilder->writePhrase(Resource id #7, '84sx', '/var/www/html/w...', 150, 40)
#1 /var/www/html/wp-content/plugins/wechat-social-login/includes/social/class-xh-social-ajax.php(203): Gregwar\Captcha\CaptchaBuilder->build()
#2 /var/www/html/wp-content/plugins/wechat-social-login/includes/social/class-xh-social-ajax.php(209): XH_Social_Ajax::{closure}()
#3 /var/www/html/wp-includes/class-wp-hook.php(286): XH_Social_Ajax::captcha('')
#4 /var/www/html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array)
#5 /var/www/html/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#6 /var/www/html/wp-admin/admin-ajax.php(99): do_action('wp_ajax_xh_soci...')
#7 {main}
  thrown in /var/www/html/wp-content/plugins/wechat-social-login/includes/captcha/CaptchaBuilder.php on line 327

網(wǎng)站查詢資料說:圖形驗(yàn)證碼功能需要安裝gd庫freetype等依賴,通過phpinfo()查看到詳細(xì)信息里:gd擴(kuò)展沒有freetype
wordpress怎么實(shí)現(xiàn)QQ微信釘釘Github手機(jī)號(hào)登陸

查看phpinfo()的方法

在網(wǎng)站的根目錄下新建一個(gè)php-info.php的文件,內(nèi)容為:

<?php

phpinfo();

保存后,用域名訪問,如https://action.liabio.cn/php-info.php,即可看到。

docker編譯鏡像

Dockerfile文件如下:

FROM wordpress:4.9.8
RUN echo 'deb http://mirrors.163.com/debian/ stretch main contrib non-free\ndeb http://mirrors.163.com/debian/ stretch-updates main contrib non-free\ndeb http://mirrors.163.com/debian/ stretch-backports main contrib non-free' > /etc/apt/sources.list
RUN apt update \
&& apt install -y libwebp-dev libjpeg-dev libpng-dev libfreetype6-dev \
&& docker-php-source extract \
&& cd /usr/src/php/ext/gd \
&& docker-php-ext-configure gd --with-webp-dir=/usr/include/webp --with-jpeg-dir=/usr/include --with-png-dir=/usr/include --with-freetype-dir=/usr/include/freetype2 \
&& docker-php-ext-install gd \
&& php -m | grep gd

執(zhí)行以下編譯命令:

docker build -t wordpress-freetype:4.9.8 .

結(jié)果編譯報(bào)錯(cuò)。

docker編譯鏡像報(bào)錯(cuò)

OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:319: getting the final child's pid from pipe caused \"EOF\"": unknown

因?yàn)槲沂褂玫氖?9.03.5版本的docker,在網(wǎng)上查了資料,大致意思是需要18版本的docker編譯才不會(huì)報(bào)錯(cuò)。

果然,18版本的docker編譯沒有報(bào)錯(cuò):
wordpress怎么實(shí)現(xiàn)QQ微信釘釘Github手機(jī)號(hào)登陸

使用集成了freetype的新鏡像

使用新鏡像后,可以看到freetype成功集成。
wordpress怎么實(shí)現(xiàn)QQ微信釘釘Github手機(jī)號(hào)登陸
可以看到二維碼已經(jīng)成功的顯示出來了。
wordpress怎么實(shí)現(xiàn)QQ微信釘釘Github手機(jī)號(hào)登陸

以上是“wordpress怎么實(shí)現(xiàn)QQ微信釘釘Github手機(jī)號(hào)登陸”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI