三分快乐,七纷幸福 发布的文章

网上查是缺少是GD库中缺少freetype库,下面是按照步骤
1、下载freetyp包
官方地址:https://download.savannah.gnu.org/releases/freetype/ 或者 https://sourceforge.net/projects/freetype/files/
执行下载:

  sudo wget https://download.savannah.gnu.org/releases/freetype/freetype-2.10.0.tar.bz2 --no-check-certificate

2、解压缩包

   sudo tar xvf freetype-2.10.0.tar.bz2 

3、进入freetype,

   cd freetype-2.10.0

4、执行编译安装

   sudo make clean
   sudo ./configure --prefix=/usr/local/php-7.3.27 --with-config-file-path=/usr/local/php-7.3.27/etc --enable-bcmath --enable-fpm --enable-sockets --enable-ftp --enable-mbstring --enable-opcache --with-gd --with-freetype-dir --with-webp-dir --with-jpeg-dir --with-png-dir --enable-zip --with-zlib-dir --enable-xml --with-bz2 --with-curl --with-gettext --with-mysqli --with-pdo-mysql --with-openssl --with-fpm-user=www --with-fpm-group=www --without-sqlite3 --without-pdo-sqlite --with-pear   (注:这里以自己的实际目录为准)
  make 
  make install
  

5、重启php

   sudo systemctl restart php-fpm

6、phpinfo()查看是否安装成功

最近对服务器日志进行排查,发现一个特别好用的命令tail, 之前查看日志使用的都是cat或者head命令,但是这两个命令只能查询查找时的检索内容,无法实时查看最新的日志请求,所以及时mark一下,命令如下:

sudo tail -f -20 xxxx.log //查找xxx.log 最后20行内容

如果需要对日志进行关键词检索,则加上 | grep "关键词内容"即可,命令如下:

sudo tail -f -20 xxxx.log | grep "500"

注(结束查看ctrl+c)

tail参数详解:
-f 循环读取
-q 不显示处理信息
-v 显示详细的处理信息
-c<数目> 显示的字节数
-n<行数> 显示文件的尾部 n 行内容
--pid=PID 与-f合用,表示在进程ID,PID死掉之后结束
-q, --quiet, --silent 从不输出给出文件名的首部
-s, --sleep-interval=S 与-f合用,表示在每次反复的间隔休眠S秒

参数详解参数:https://www.runoob.com/linux/linux-comm-tail.html

示例:

function delDirFile($dir) {
    //先删除目录下的文件:
    $dh=opendir($dir);
    while ($file=readdir($dh)) {
        if($file!="." && $file!="..") {
            $fullpath=$dir."/".$file;
            if(!is_dir($fullpath)) {
                unlink($fullpath);
            } else {
                deldir($fullpath);
            }
        }
    }
    closedir($dh);
    //删除当前文件夹:
    if(rmdir($dir)) {
        return true;
    } else {
        return false;
    }
}

//用法
$dir = "/User/xxx/Sites/xxx/";
delDirFile($dir);