mac 监控文件变化并重启php
自己撸一个框架,需要监控代码变化
安装fswatch
brew install fswatch
#!/bin/sh
do
ps -ef | grep php | grep -v grep | awk '{print $2}' | xargs kill -9
php /Users/x/www/php/LightMoon/examples/index.php
done
监控文件变化目录
fswatch -0 /Users/x/www/php/LightMoon| xargs -0 -n 1 /Users/x/www/php/LightMoon/bin/reload.sh
- 上一篇 »升级mac的PHP版本
- 下一篇 »在linux和Mac中访问某个文件夹中所有的文件