分类 默认 下的文章
lnmp1.8 部署tp5 出现空白
在centos7.5主机部署了lnmp1.8环境
部署thinkphp5的程序时候,rewrite转发配置正常。但显示空白,经过多番研究,发现是fastcgi的安全目录open_Dir问题
/usr/local/nginx/conf
【fastcgi.conf】
大概在26-27行
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
#未改前
#fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
#修改后
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/../:/tmp/:/proc/";
OK 大功告成
linux 的.user.ini怎么删除
解锁
chattr -i /站点目录/.user.ini
删除
rm -rf 站点目录
tp5 在Nginx部署转发机制htacess
#转发机制
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}
composer require报错[InvalidArgumentException] Could not find package
原因:镜像源出现问题
修改镜像源:
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
更换成阿里云镜像云即可
mysql 查询全库某字段出现的次数
SELECT * from information_schema.columns where TABLE_SCHEMA='new_ejiegd_com' and COLUMN_NAME='uid'
其中new_ejiegd_com为数据库名
uid为字段名
linux 查看进程 ps -ef
ps -ef
ps aux
使用sort对CPU占用进行排序
ps aux|sort -nr -k3
sort #排序命令
-nr #默认使用字符串排序n代表使用数值进行排序 默认从小到大排序 r代表反向排序
-k3 #以第3列进行排序
把输入第一行删除然后剩余的行参与排序并去前10位
ps aux|grep -v PID|sort -nr -k3|head -n10
如需要显示PID则先运行输出第一行然后再进行排序
ps aux|head -n1;ps aux|grep -v PID|sort -nr -k3|head -n10
同理输出内存占用多的进程,内存参数在第四行
ps aux|head -n1;ps aux|grep -v PID|sort -nr -k4|head -n10