Home  >  Article  >  Backend Development  >  web页面php调用shell脚本,执行svn update 更新的问题。

web页面php调用shell脚本,执行svn update 更新的问题。

WBOY
WBOYOriginal
2016-06-02 11:28:271459browse

phpsvnshellweb

大神们,求救!

SvnUpdate.php代码:
set_time_limit(0);
system("/usr/bin/sudo /usr/www/SvnUpdate.sh");
?>

SvnUpdate.sh代码:
time="$(date +"%Y%m%d-%H%M%S")"
codes="/usr/www/codes"

#update the codes from SVN server
/usr/bin/svn update $codes/tiyushe --username xx --password xx --no-auth-cache

出现问题:
1、在linux终端,www(root)用户 执行 php SvnUpdate.php 能正常更新
2、在web页面,点击按钮,则一片空白
3、如果把update 换成checkout 或者是 export ,Linux终端和web页面都能正常执行。。

会是什么原因呢?排查了一天了。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn