问题展示一:yii\base\ErrorException:md5_file():SSLoperationfailedwithcode1.OpenSSLErrormessages:error:14090086:SSLroutines:ssl3_get_server_certificate:certificateverifyfailed处理方式:修改php.ini文件配置参数,实测我的是linux宝塔面板PHP-7.4.33.将allow_url_include=off改为allow_url_include=On,然后重启服务。结果出现问题二,继续解决问题展示一:yii\base\ErrorException:failedloadingcafilestream:`/www/server/php/74/cert.pem'处理方式:查看SSL证书不存在,宝塔面板内置的证书名称是:cacert.pem(猜测可能是宝塔官方待优化的问题)将cacert.pem拷贝一份,名称变更为cert.pem修改php.ini文件配置参数,证书路径#openssl.cafile=/etc/pki/tls/certs/ca-bundle.crtopenssl.cafile=/www/server/php/74/cert.pem重启PHP服务,问题解决完成。
入门安装此扩展的首选方法是通过composer。phpcomposer.pharrequire2amigos/qrcode-library:~1.1或添加"2amigos/qrcode-library":"^2.0"实际代码使用示例useDa\QrCode\Contracts\ErrorCorrectionLevelInterface;useDa\QrCode\QrCode;useDa\QrCode\Label;publicfunctiongetRoleList($param=null){$label=(newLabel('helloworld!!!'))//实例化文字->setFont(__DIR__.'/../resources/fonts/monsterrat.otf')//引入字体->setFontSize(12);//设置文字大小return(newQrCode("helloword!!!"))//生成内容->setErrorCorrectionLevel(ErrorCorrectionLevelInterface::HIGH)//容错级别->setLogo(__DIR__.'/data/logo.png')//设置logo->setLogoWidth(60)//设置logo大小->setSize(300)//二维码大小->setEncoding('UTF-8')//设置编码格式->setForegroundColor(51,153,255)//设置二维码颜色->setBackgroundColor(200,220,210)//设置背景颜色->setMargin(5)->setLabel($label)//设置二维码底部文字->writeDataUri();//导出方式为base64}
微信公众号开发,换成本地接口后出现cURLerror60:SSLcertificateproblem:unabletogetlocalissuercertificate(seehttps://curl.haxx.se/libcurl/c/libcurl-errors.html)解决方式:从https://curl.haxx.se/docs/caextract.html上下载cacert.pem打开php.ini搜索curl.cainfo与openssl.cafile,将其配置成你自己cacert.pem文件的路径curl.cainfo=”你的绝对路径“openssl.cafile=”路径”你的绝对路径:示例:”C:\xampp\php\extras\ssl\cacert.pem”)保存重启web服务