composer require报错[InvalidArgumentException] Could not find package
原因:镜像源出现问题
修改镜像源:
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
更换成阿里云镜像云即可
原因:镜像源出现问题
修改镜像源:
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
更换成阿里云镜像云即可
SELECT * from information_schema.columns where TABLE_SCHEMA='new_ejiegd_com' and COLUMN_NAME='uid'
其中new_ejiegd_com为数据库名
uid为字段名
ps -ef
#关闭服务
public function closed(){
if(strpos(PHP_OS,"Linux")!==false){
#Linux套字
$exec_power ="kill -s 9 `ps -aux | grep queue| grep -v grep | awk '{print $2}'`";
//$exec_power ='cd '. ROOT_PATH .'; php think queue:restart';
}else if(strpos(PHP_OS,"WIN")!==false){
#Win套字
$exec_power ='cd /d '. ROOT_PATH .' & php think queue:restart ';
}else{
$this->error('未识别的操作系统');
}
#命令执行
$message ='';
try {
$message = shell_exec($exec_power);
} catch (\Exception $e) {
$message = $e->getMessage();
}
$this->success('关闭服务成功','',$exec_power);
}
#启动服务
public function powers(){
$id =$this->request->param('id');
$info=$this->model->where(array('id'=>$id))->find();
$daemon =1;
#获取标识
$job_code =$info['job_code'];
if(!empty($job_code)){
#判断win还是linux
if(strpos(PHP_OS,"Linux")!==false){
#Linux套字
if($daemon){
//$exec_power ='cd '. ROOT_PATH .'; php think queue:work --queue ' .$job_code.' --daemon';
//后台挂起 不同等待
$exec_power ='cd '. ROOT_PATH .'; php think queue:work --queue ' .$job_code.' --daemon > /dev/null 2> /dev/null &';
}else{
$exec_power ='cd '. ROOT_PATH .'; php think queue:work --queue ' .$job_code;
}
}else if(strpos(PHP_OS,"WIN")!==false){
#Win套字
if($daemon){
//$exec_power ='cd /d '. ROOT_PATH .' & php think queue:work --queue ' .$job_code.' --daemon';
$exec_power ='cd /d '. ROOT_PATH .' & start /B php think queue:work --queue ' .$job_code.' --daemon';
}else{
$exec_power ='cd /d "'. ROOT_PATH .'" & php think queue:work --queue ' .$job_code;
}
}else{
$this->error('未识别的操作系统');
}
#命令执行
$message ='';
if($daemon>0){
$message =pclose(popen($exec_power, 'r'));
//$message =shell_exec($exec_power);
}else{
try {
$message = shell_exec($exec_power);
} catch (\Exception $e) {
$message = $e->getMessage();
}
}
$this->success('启动成功','',$exec_power);
}else{
$this->error('未找到对应的任务标识');
}
}
批量杀死 queue:work 的进程
kill -s 9 `ps -aux | grep queue:work| grep -v grep | awk '{print $2}'`
查找大于10M的日志文件
find / -name "*.log" -size +10M
查找大于10M的日志文件并删除
find / -name "*.log" -size +10M -exec rm -rf {} \;
查找大于1M的日志文件并删除
find / -name "*.log" -size +1M -exec rm -rf {} \;
查找所有的日志文件并删除
find / -name "*.log" -exec rm -rf {} \;
故障代码:php-network-getaddresses:getaddrinfo-failed:name or service not known
排查命令:
1.查看网卡
cat /etc/resolv.conf
2.重启php-fpm
service php-fpm restart