🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
linux 系统下 使用python调用php脚本方法 sh调用php文件 ~~~ #!/usr/bin/python # -*- coding: UTF-8 -*- import os import time import random path = os.chdir("/data/wwwroot/www.xxx.com") #切换目录 while True: #随机睡眠 t = random.randint(1,5) time.sleep(t) # 执行php脚本 os.system("php /data/wwwroot/www.xxx.io/index.php") ~~~ sh调用php脚本 ~~~ cd /data/wwwroot/www.xxx.com/ while true do php /data/wwwroot/www.xxx.com/index.php # 睡眠10秒 sleep 10 done 传递值 cd /www/wwwroot/ethereum/ thinkphp框架中 执行某个方法 while true do php /www/wwwroot/ethereum/index.php Admin/Test/test # 睡眠10秒 sleep 10 done ~~~