PHP实现红包函数
在移植支付宝收款人时,重新设置了商户的公钥 my_public,并重新获取新的支付宝公钥 alipay_public。 但在支付成功后,对支付宝回调数据签名验证时,出现签名验证失败的情况。 经过查询回调日志,发现必须对 alipay_public公钥重新修改成带有注释的部分,如下: —–BEGIN PUBLIC KEY—– (这里是注释) MI***************************************************uc (注意这里是换行) k******************************************************2 p******************************************************B —–END PUBLIC KEY—–
php中,使用memcache作为session的save handler 一般会使用如下设置: php.ini里: session.save_handler = memcache session.save_path = “localhost:11211″ 项目配置里: ini_set(“session.save_handler”, “memcache”); ini_set(“session.save_path”, “127.0.0.1:11211″); 在网上很多资料会写成这样: session.save_path = “tcp://localhost:11211″ 就是连接前缀里添加了tcp:// 这是会导致php的memcache模块写入失败,切记一定不要添加tcp协议前缀! 原文:http://php.net/manual/en/memcached.sessions.php session.save_path string Defines a comma separated of hostname:port entries to use for session server pool, for example “sess1:11211, sess2:11211″. If you want to use ‘memcacheD’ extention not ‘memcache’ (there are two diffrent extentions) for session [Read More →]
在做一个接口的时候,使用file_get_contents出现 HTTP request failed! HTTP/1.1 505 HTTP Version Not Supported error。查了一下手册, Note: 如果要打开有特殊字符的 URL (比如说有空格),就需要使用 urlencode() 进行 URL 编码。 切记,对中文一定要进行先编码后使用
configure: error: xml2-config not found. Please check your libxml2 installation. yum install libxml2-devel.x86_64 configure: error: Cannot find OpenSSL’s yum install openssl-devel.x86_64 configure: error: Could not find pcre.h in /usr/local yum install pcre-devel.x86_64 configure: error: Could not find pcre.h in /usr/local “–with-pcre-regex=/usr/include” \ configure: error: Could not find libpcre.(a|so) in /usr/include “–with-pcre-regex=/usr” \ configure: error: Please [Read More →]
php5 apache2.2 安装时出现 libphp5.so: cannot restore segment prot after reloc: Permission denied 的原因及解决办法
问题:后台如下,直接查看后台,源代码存在,但是就是显示不出来。
解决办法:这是因为utf-8 编码的html 文件里面包含BOM造成的,可以使用专门的程序去掉bom,查看这里,也可以把这个html文件删除了,重新建立。注意可以把源代码先复制在其他utf8编辑器里,比如 editplus,然后重新建立