在php中调用shell脚本

sh/bash/dash/ksh/zsh等Shell脚本
回复
gxwu
帖子: 3
注册时间: 2014-11-09 9:44
系统: ubuntu14.04

在php中调用shell脚本

#1

帖子 gxwu » 2014-11-09 9:51

test.sh 脚本如下:
#!/bin/bash
echo "hello";
echo "hello" > 1.txt;

在一个php页面中用echo shell_exec("/var/www/html/ftp_upload/test.sh");调用test.sh这个脚本,其中能够执行echo "hello",这条语句,但是echo "hello" > 1.txt;却无法执行,其各位大神讲解?
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

Re: 在php中调用shell脚本

#2

帖子 eexpress » 2014-11-09 14:58

一层管一层的权限吧。
● 鸣学
gxwu
帖子: 3
注册时间: 2014-11-09 9:44
系统: ubuntu14.04

Re: 在php中调用shell脚本

#3

帖子 gxwu » 2014-11-09 17:45

谢谢。是权限问题!
回复