随笔分类 -  PHP

摘要:用RedisCluster方案 https://pecl.php.net/package/redis https://github.com/JetBrains/phpstorm-stubs/blob/master/redis/RedisCluster.php new RedisCluster($na 阅读全文
posted @ 2020-05-08 10:30 jking10 阅读(353) 评论(0) 推荐(0)
摘要:$headers = array( //"Content-type:application/json;charset='utf-8'", "Cache-Control:no-cache", "Pragma:no-cache", //"accept-charset:utf-8", "Accept-En 阅读全文
posted @ 2017-11-17 18:25 jking10 阅读(3338) 评论(0) 推荐(0)
摘要:在PHP中我们可以通过str_split 将字符串转换为数组,但是却对中文无效,下面记录一下个人将中文字符串转换为数组的方法。 用到的PHP函数 mb_strlen — 获取字符串的长度 function ch2arr($str){ $length = mb_strlen($str, 'utf-8' 阅读全文
posted @ 2017-08-17 13:55 jking10 阅读(1456) 评论(0) 推荐(0)
摘要:之前用Sphinx(coreseek)几次,相对正常 这次用到,记录些问题 1.coreseek好像没人维护了吗,有点可惜。 2.centOS7 编译和coreseek版本有点问题,需要修改编译文件 3.操作系统内核,gcc版本,编译可能会遇到问题;一般更新下gcc最新版 4.php7的sphinx 阅读全文
posted @ 2017-08-16 16:38 jking10 阅读(170) 评论(0) 推荐(0)
摘要:1 SSL: certificate subject name 'WMSvc-GWAMSERVER02' does not match target host name 把curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); 2 Curl error: S 阅读全文
posted @ 2017-08-02 14:31 jking10 阅读(1811) 评论(0) 推荐(0)
摘要:<?php//服务器信息$server = 'udp://127.0.0.1:7002';// UDP Server$msgEof = "\n";$socket = stream_socket_server($server, $errno, $errstr, STREAM_SERVER_BIND); 阅读全文
posted @ 2017-07-28 12:19 jking10 阅读(329) 评论(0) 推荐(0)
摘要:CURLOPT_DNS_USE_GLOBAL_CACHE 启用时会启用一个全局的DNS缓存,此项为线程安全的,并且默认启用。CURLOPT_DNS_CACHE_TIMEOUT 设置在内存中保存DNS信息的时间,默认为120秒。 1)fopen/file_get_contents 每次请求远程URL中 阅读全文
posted @ 2017-03-21 18:16 jking10 阅读(8471) 评论(1) 推荐(2)
摘要:域名www.test.com解析内部多台ip $httpHeader = array('Host: www.test.com');$url = "10.17.2.245/xxx/xxx/t.php"; $ch = curl_init();curl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeader);curl_setopt($ch, CURLOPT_UR... 阅读全文
posted @ 2017-03-21 18:09 jking10 阅读(18108) 评论(0) 推荐(0)
摘要:内存:32G CPU:2个6核 接口数据deflate 压缩后 均不到10k, php7 Concurrency Level: 100 Time taken for tests: 1.264 secondsComplete requests: 10000Failed requests: 9999 ( 阅读全文
posted @ 2017-03-10 19:07 jking10 阅读(2234) 评论(0) 推荐(1)
摘要:openresty相同版本,rewrite 遇到静态资源访问404,需要先吧静态资源设为访问 server { listen 80; server_name www.baidu.com.cn; root /data/cehuiren/public; index index.php index.htm 阅读全文
posted @ 2017-01-25 16:21 jking10 阅读(298) 评论(0) 推荐(0)
摘要:redis的官方github这么说: phpredis can be used to store PHP sessions. To do this, configure session.save_handler and session.save_path in your php.ini to tel 阅读全文
posted @ 2016-07-27 13:58 jking10 阅读(1112) 评论(0) 推荐(0)
摘要:PHP 5.5以上 使用 CURL 上传文件的代码: 阅读全文
posted @ 2016-04-08 17:25 jking10 阅读(185) 评论(0) 推荐(0)
摘要:===============================================yum install error: protected multilib versions error===============================================sudo... 阅读全文
posted @ 2016-01-06 20:39 jking10 阅读(2761) 评论(0) 推荐(0)
摘要:php.ini disable_functions 禁用某些函数需要时注意打开php-fpm 对应conf user group为root时ERROR: [pool www] please specify user and group other than rootphp-fpm -R -R, -... 阅读全文
posted @ 2015-11-28 19:19 jking10 阅读(461) 评论(0) 推荐(0)
摘要:表 42-2. 安全模式限制函数函数名限制dbmopen()检查被操作的文件或目录是否与正在执行的脚本有相同的 UID(所有者)。dbase_open()检查被操作的文件或目录是否与正在执行的脚本有相同的 UID(所有者)。filepro()检查被操作的文件或目录是否与正在执行的脚本有相同的 UID... 阅读全文
posted @ 2015-11-28 17:07 jking10 阅读(505) 评论(0) 推荐(0)
摘要:本文结合php官网和鸟哥相关文章总结: 官网:http://www.php7.ca/https://wiki.php.net/phpng PHP7将在2015年10月正式发布,PHP7 ,将会是PHP脚本语言的重大版本更新,同时将带来大幅的性能改进和新的特性,以及改进一些过时功能。该 发布版本... 阅读全文
posted @ 2015-11-18 12:03 jking10 阅读(246) 评论(0) 推荐(0)
摘要:class test_thread_run extends Thread{public $url;public $data;public function __construct($url){$this->url = $url;}public function run(){if(($url = $t... 阅读全文
posted @ 2015-11-07 22:54 jking10 阅读(645) 评论(0) 推荐(0)
摘要:信息加密技术的分类单项散列加密技术(不可逆的加密)属于摘要算法,不是一种加密算法,作用是把任意长的输入字符串变化成固定长的输出串的一种函数MD5string md5 ( string $str [, bool $raw_output = false ] ); //MD5加密,输入任意长度字符串返回一... 阅读全文
posted @ 2015-11-02 23:02 jking10 阅读(370) 评论(0) 推荐(0)
摘要:=================== 优化设置 =========================When you running a highload website with PHP-FPM via FastCGI, the following tips may be useful to yo... 阅读全文
posted @ 2015-07-31 22:22 jking10 阅读(1585) 评论(0) 推荐(0)
摘要:Windows 重度用户只能用 for windows 的软件了,所以虽然使用 Git,但还是要找专门的 windows 版本。最近开始使用 GitHub 来托管一些小项目/兴趣,而自己是重度 win 用户,所以完全命令行总是不习惯(好吧,懒得记命令)。然后我用 GitHub for Windows... 阅读全文
posted @ 2015-07-01 16:54 jking10 阅读(244) 评论(0) 推荐(0)