shell脚本
来源:互联网 发布:网络电缆 编辑:程序博客网 时间:2024/06/17 23:07
shell脚本运行PHP文件
1.首先编写PHP文件
<?phpheader('content-type:text/html;charset=utf-8');echo 1;?>
2.编写shell脚本文件
# vi mianshi.sh#!/bin/bash$(php /phpstudy/www/mianshi.php) //有时候系统不支持这种,可以直接运行 php /phpstudy/www/mianshi.phpexit 0chmod 755 mianshi.sh//试着运行一下./mianshi.sh
如下图操作所示
接下来我们做计划任务,运行此命令 :crontab -e
保存退出,1分钟执行一次脚本
PHP编写
$redis = new Redis();$redis->connect('127.0.0.1',6379);$ping = $redis->rPop('ping');$ping = unserialize($ping); $db = new PDO('mysql:host=127.0.0.1;dbname=questions','root','root');$db->exec('set names utf8');$sql = "select * from users";$res = $db->query($sql);
阅读全文
0 0
- shell脚本
- shell脚本
- shell脚本
- shell脚本
- shell脚本
- shell脚本
- shell脚本
- shell 脚本
- SHELL 脚本
- shell脚本
- shell脚本
- shell 脚本
- shell脚本
- shell脚本
- shell脚本
- shell脚本
- shell脚本
- shell脚本
- 贪心,括号序列(Rikka with Parenthesis II,HDU 5831)
- property-placeholder源码解析
- JAVA薪资计算
- php.ini
- 11. Servlet 文件上传
- shell脚本
- Chloe and the sequence
- Unable to restore source lookup path
- vue动态添加class
- python 发送邮件(文字、表格、附件)
- AngularJS 服务(Service)
- c语言对执行文件的简单保护
- iOS远程控制问题,系统远端事件remoteControlReceivedWithEvent捕获不到的问题
- Android开发之路——文静小菜鸟要开始努力啦