![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PHP
下圉天天
阶砖不会拒绝磨蚀 窗花不可幽禁落霞。
展开
-
Fatal error: Method ReflectionParameter::getClass() is deprecated
think PHP 5.x会出现这个问题。 降php 版本 就可以。原创 2022-01-11 15:08:36 · 827 阅读 · 0 评论 -
PHP+QueryList采集网页
$url = ''; $rules = [ 'title' => ['.item-title', 'text'], 'second'=>['.flexitme','html'] ]; $ql = QueryList::get($url, [], [ 'headers' => [ ...原创 2021-09-28 10:51:38 · 189 阅读 · 0 评论 -
宝塔计划 任务执行thinkphp脚本
cd /www/wwwroot/test.com/ && php think content原创 2021-08-31 16:28:37 · 764 阅读 · 0 评论 -
网站生成静态页
1.curl获取内容2.写文件 $html = Request::curl($_SERVER['HTTP_HOST']. $value["custom_url"], null, false, false); //判断是否需要生成目录 if (strpos($value["custom_url"], '/') !== false) { $dirs = str_replace(substr($valu原创 2021-08-27 15:01:08 · 105 阅读 · 0 评论 -
gitlab:gitlab-runner多服务器自动部署项目
服务器gitlab 已经搭建好搭建gitlab-runner 服务器之间建立免密登陆 跑.gitlab-ci.yml搭建gitlab-runner1.下载执行文件sudo wget -O/usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd642.设置执行权限sudo chmod +x /usr/lo..原创 2021-08-27 14:52:48 · 1498 阅读 · 0 评论 -
your php version (8.0.0) does not satisfy that requirement
- lcobucci/jwt[3.3.0, ..., 3.4.5] require php ^5.6 || ^7.0 -> your php version (8.0.0) does not satisfy that requirement. - Root composer.json requires lcobucci/jwt ^3.3 -> satisfiable by lcobucci/jwt[3.3.0, ..., 3.4.5]. - facebook/webd...原创 2021-07-19 14:45:56 · 2562 阅读 · 1 评论 -
jquery(Autocomplete)+php 文本框模糊匹配
这里引用的是jQuery UI组件 需要引入的源文件 官方文档是需要引入三个资源文件(重点是那两个js文件) <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.9.1.js"></script> <script src="//cod原创 2021-04-02 10:49:56 · 184 阅读 · 2 评论 -
WordPress + PHP 8.0 出现错误的部分解决办法
PHP Warning在设置主题的时候出现:Warning: Only the first byte will be assigned to the string offset in /path/wp-includes/class.wp-scripts.php on line 492其中一个错误如上所示,这个警告指向的是wp-includes/class.wp-scripts.php文件,这是WordPress的一个核心文件。一开始,我想很多小伙伴会和笔者一样认为是WordPress自己的错误,转载 2021-02-26 14:12:11 · 2842 阅读 · 0 评论 -
关于坑爹的.user.ini文件
最近一直在倒腾cms 线上部署的时候 经常会碰到项目报 No input file specified 试了网上超级多方法!!!一直不行!!!见鬼!后面发现是项目有设置防跨目录设置 是.user.ini的问题一:关于.user.iniphp官方文档关于.user.ini文件:https://www.php.net/manual/zh/configuration.file.per-user.php配置文件(php.ini)在 PHP 启动时被读取。对于服务器模块版本的 PHP,仅在 web 服务.原创 2021-02-24 09:51:28 · 1499 阅读 · 0 评论 -
抓取网页工具querylist的使用简介
querylist的使用首先,querylist是时下php最先进的dom采集包之一,而且是国人写的,中文文档很好,如果想用好,应该直接看一遍官方文档我这里简单记录下我对querylisty使用的理解。目标是用一篇文章解释如何使用。方便我超过2个月后回忆....操作流程主要分为三步载入资源 筛选目标 读取结果举例:<?phprequire 'QueryList/vendor/autoload.php';use QL\QueryList;$html = <...转载 2021-01-25 09:47:07 · 1357 阅读 · 0 评论 -
Array and string offset access syntax with curly braces is no longer support
PHP7.4不再能够使用花括号来访问数组或者字符串的偏移.需要将{}修改成[] 就可以解决问题若代码逻辑中含有类似 $asc = ord($s{0}) * 256 + ord($s{1}) - 65536;需要修改成 $asc = ord($s[0]) * 256 + ord($s[1]) - 65536;...原创 2021-01-19 10:44:24 · 12103 阅读 · 1 评论 -
yii 的crud生成器
比较要注意的是views path 默认是生成在web层底下的 , 要想生成在views文件夹 需要路径回退下 ../views/website原创 2021-01-16 10:03:03 · 124 阅读 · 0 评论 -
yii2 ajax的post提交出现的400错误
public function beforeAction($action) { $this->enableCsrfValidation = false; return parent::beforeAction($action); }原创 2021-01-12 15:31:19 · 90 阅读 · 0 评论 -
PHP远程图片下载到本地
function getImage($url, $save_dir = '', $filename = '') { if (trim($url) == '') { return array('file_name' => '', 'save_path' => '', 'error' => 1); } if (trim($save_dir) == '') { $save_dir =...原创 2021-01-05 13:51:00 · 111 阅读 · 0 评论 -
宝塔部署项目报Warning: require(): open_basedir restriction in effect的解决方案
关闭防跨站攻击(open_basedir)即可!记得重启PHP服务!!!!!!转载 2020-12-31 16:48:33 · 305 阅读 · 0 评论 -
php报错“ERR_CONTENT_DECODING_FAILED”的通用解决办法
先看字面意思:内容解码失败1、在哪里给内容加码了? 可能页面有echo 部分数据2、* nginx、php、框架*3、 检查 nginx 配置, gzip 开启状态。关闭 gzip 并重启,无效。排除4、检查 php 配置, zlib.output_compression ,发现是关闭的。开启配置并重启,页面正常。5、 检查框架,发现框架内在 output_compression 关闭的时候,会使用 ob_gzhandler 函数,找到原因6、之所以使用 ob_gzhandle.原创 2020-12-08 12:16:11 · 1196 阅读 · 0 评论 -
yii2 在执行save()操作的时候debug 报Model not inserted due to validation error.
有可能的原因是:1.字段类型传不正确2.必传参数没有传3. yii自动生成的rule问题 。 比如限制了max 的大小 或者自动生成的字段类型不正确原创 2020-12-08 12:15:18 · 334 阅读 · 0 评论 -
有效的字母异位词-php
异位词: 长度一样,包含的字母一样,每个字符出现的频率一样,只是顺序不同(相等的字符串也是)给定两个字符串 s 和 t ,编写一个函数来判断 t 是否是 s 的字母异位词。示例1:输入: s = "anagram", t = "nagaram"输出: true示例 2:输入: s = "rat", t = "car"输出: false思路:1.判断字符串长度2.字符串排序php无可用函数调用 先用split转成数组 再进行排序class Soluti...原创 2020-11-22 16:07:58 · 104 阅读 · 0 评论 -
查看php当前进程数
root用户下执行netstat -napo |grep "php-fpm" | wc -l原创 2020-07-21 16:09:30 · 1110 阅读 · 0 评论 -
number_format的坑
⚠️:带千分位的 也无法进行正常运算的 所以最好运算后再number_format 不要在运算前在项目中碰到一个坑数据库的存储类型是demical然后在处理数据的时候用number_format处理 带千分位的会被转成整型$test1='1000.00';var_dump(number_format($test1,2));-------》'1,000.00'$test2='1,000.00';var_dump(number_format($test2,2));-------...原创 2020-06-09 16:21:23 · 356 阅读 · 0 评论