使用git pull
在服务器上更新代码,经常导致权限变了,日志没有写进去,怎么解决?
直接在服务器上 git pull
拉代码,经常需要:
chown -R www.www /data/wwwroot/
find /data/wwwroot/ -type d -exec chmod 755 {} \;
find /data/wwwroot/ -type f -exec chmod 644 {} \;
来解决问题,不然有时会造成日志写不进去 error_log($content, 3, $logFile);
要怎么解决这个问题呢?
或者是我这样使用git来部署代码的方式有问题
还是和git的配置有关,git config core.filemode false
这样可以解决吗,怀疑是git拉的时候更改的www/log
目录的权限。
可以这么做,使用运行php-fpm的用户去运行命令
替换
/root/.ssh/id_rsa
key路径