sbzhu / weworkapi_php

official lib of wework api
https://work.weixin.qq.com/api/doc
355 stars 286 forks source link

php7.1.9 测试回调验证,总是报错。。= =! #6

Closed xiaoyouxi01 closed 6 years ago

xiaoyouxi01 commented 6 years ago

用php7.1.9测试callback/Sample.php回调验证,总是报错。。。

第一次测试,结果: ①Notice: Use of undefined constant HttpUtils - assumed 'HttpUtils' ②Fatal error: Uncaught Error: Call to undefined function ParseUrl()

于是将HttpUtils.ParseUrl都修改成$_GET,进行第二次测试: $sVerifyMsgSig = $_GET["msg_signature"]; $sVerifyTimeStamp = $_GET["timestamp"]; $sVerifyNonce = $_GET["nonce"]; $sVerifyEchoStr = $_GET["echostr"]; 没了HttpUtils.ParseUrl就不报第一次测试的那个错误了,但是新的提示: Function XXXX() is deprecated 这里XXXX()涉及好几个函数,都是提示deprecated mcrypt_module_open mcrypt_generic_init mdecrypt_generic mcrypt_generic_deinit mcrypt_module_close PHP官方文档显示:http://www.php.net/manual/en/function.mcrypt-module-open.php This function has been DEPRECATED as of PHP 7.1.0. Relying on this function is highly discouraged. 这些函数从php7.1.0开始已经不建议使用了。。。

最后无奈,由于我是用WampServer v3.1.0搭建的环境,所以将php版本切换到了7.0.23,这才成功。

xiaoyouxi01 commented 6 years ago

希望改用OpenSSL来代替Mcrypt,以兼容新版本的php~

sbzhu commented 6 years ago

已用OpenSSL代替,感谢 @xiaoyouxi01