PHP编译安装时可添加参数 --with-zlib --with-libzip-dir=/usr/lib --enable-zip如果没有带,可到php安装目录下 ext/zip目录安装 依次执行phpize #php目录的/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make -j2 && make install编译成功后,找到php.ini安装目录/usr/local/php/bin/php -i | grep php.ini修改php.ini 配置后 重启php-fpm或者 直接执行 /usr/local/php/bin/php -m 查看是否包含zip依赖。php-fpm 关闭kill -INT `cat /usr/local/php/var/run/php-fpm.pid`php-fpm 启动/usr/local/php/sbin/php-fpm如果启动时没提示信息表示安装成功Install ZIP extension for php on CentOS
在 Linux 中,有多种方式可以用来传输文件。这里列出几种常见的方法:SSH 文件传输(Secure Copy, scp)scp 命令是一个基于 SSH 协议的文件拷贝工具。它可以用于主机之间的文件复制。使用示例:将本地文件发送到远程服务器:scp /local/path/to/file user@remotehost:/remote/path/to/directory/从远程服务器获取文件:scp user@remotehost:/remote/path/to/file /local/path/to/directory/SFTP(SSH File Transfer Protocol)SFTP 是一个通过 SSH 进行文件传输的协议。你可以使用 sftp 命令或者图形界面工具如 FileZilla 来进行文件传输。使用示例:使用命令行:sftp user@remotehost登录后,你可以使用 put 和 get 命令来上传或下载文件。FTP(File Transfer Protocol)FTP 是一个较旧的文件传输协议,不过仍然被广泛支持。它不如 SFTP 安全,但在某些情况下可能
使用 nohupnohup scp -r user@remote:/path/to/remote/dir /local/dirscreen命令# centos安装screen yum install -y screen使用screen命令# 创建一个新的窗口 screen -S test # 进入窗口后 执行文件 python test.py # 退出当前窗口 ctrl+a+d (方法1:保留当前窗口) screen -d (方法2:保留当前窗口) exit (方法3:退出程序,并关闭窗口) # 查看窗口 screen -ls # 重新连接窗口 screen -r id或窗口名称 # 示例: screen -r 344 screen -r test详细看这里:Linux——让程序在后台运行(四种方法+使用推荐)
scp(Secure Copy Protocol)是一种基于SSH的文件传输工具,用于在不同计算机之间安全地复制文件。以下是一些常用的 scp 参数及其介绍:-r:递归复制目录及其内容。scp -r user@remote:/path/to/remote/dir /local/dir-P:指定SSH连接的端口(注意是大写的P)。scp -P 2222 user@remote:/path/to/remote/file /local/dir-i:指定身份文件(私钥文件)。scp -i /path/to/private/key user@remote:/path/to/remote/file /local/dir-l:限制带宽,以Kbit/s为单位。scp -l 1000 user@remote:/path/to/remote/file /local/dir-v:详细模式,显示调试信息。scp -v user@remote:/path/to/remote/file /local/dir-C:启用压缩。scp -C user@remote:/path/to/remote/file /local
关于Linux中的crontab日志记录,系统通常会将cron守护进程执行的任务的相关信息记录到日志文件中,方便管理员进行故障排查和监控任务执行情况。日志位置:在某些Linux发行版中,默认的crontab日志存放位置可能是 /var/log/cron 或 /var/log/syslog,或者在修改了rsyslog配置后指向 /var/log/cron.log。另外,在一些系统中,如果cron作业的标准输出或错误输出没有重定向,这些输出会被发送到相关用户的邮件箱,例如,root用户的邮件日志可能位于 /var/spool/mail/root,可以通过 tail -f /var/spool/mail/root 查看。启用日志记录:如果系统默认未开启cron日志记录,需要编辑rsyslog配置文件(如 /etc/rsyslog.d/50-default.conf 或全局配置文件 /etc/rsyslog.conf),取消对cron日志记录的注释(删除#符号)。配置变更后,通常需要重启rsyslog服务来应用新的设置,可以通过命令 sudo systemctl restart rsyslog
风里来
最后,我终于解放了我自己……