您好,欢迎访问一九零五行业门户网

通过打开url的方式访问php脚本来通过执行popen()函数来执行svn更新

header(cache-control:no-cache,must-revalidate);$handle = popen('svn --version','r'); $read = stream_get_contents($handle);echo ;printf($read);echo

; pclose($handle);代码来源张宴n年前的博客:http://blog.s135.com/post/371/2/1/
这样在浏览器上访问输出的结果ok
svn, version 1.6.11 (r934486) compiled apr 11 2013, 16:13:51
copyright (c) 2000-2009 collabnet. subversion is open source software,
see http://subversion.tigris.org/ this product includes software
developed by collabnet (http://www.collab.net/).
the following repository access (ra) modules are available:
ra_neon : module for accessing a repository via webdav protocol using neon.
handles 'http' scheme handles 'https' scheme ra_svn : module for accessing a repository using the svn network protocol.
with cyrus sasl authentication handles 'svn' scheme ra_local : module for accessing a repository on local disk.
handles 'file' scheme 把第二行代码换成
popen('svn up --username zmk --password 123456 /home/wwwroot/test/','r');
就不行了(什么都不输出)。
如果把第二行代码换成
popen('svn up --username zmk --password 123456 /home/wwwroot/xxx/','r');
这里的/home/wwwroot/xxx是错误的地址,最终页面会输出
skipped '/home/wwwroot/xxx'
求linux大神看看现在这个脚本的用户组和用户是www:www
回复内容: header(cache-control:no-cache,must-revalidate);$handle = popen('svn --version','r'); $read = stream_get_contents($handle);echo ;printf($read);echo

; pclose($handle);代码来源张宴n年前的博客:http://blog.s135.com/post/371/2/1/
这样在浏览器上访问输出的结果ok
svn, version 1.6.11 (r934486) compiled apr 11 2013, 16:13:51
copyright (c) 2000-2009 collabnet. subversion is open source software,
see http://subversion.tigris.org/ this product includes software
developed by collabnet (http://www.collab.net/).
the following repository access (ra) modules are available:
ra_neon : module for accessing a repository via webdav protocol using neon.
handles 'http' scheme handles 'https' scheme ra_svn : module for accessing a repository using the svn network protocol.
with cyrus sasl authentication handles 'svn' scheme ra_local : module for accessing a repository on local disk.
handles 'file' scheme 把第二行代码换成
popen('svn up --username zmk --password 123456 /home/wwwroot/test/','r');
就不行了(什么都不输出)。
如果把第二行代码换成
popen('svn up --username zmk --password 123456 /home/wwwroot/xxx/','r');
这里的/home/wwwroot/xxx是错误的地址,最终页面会输出
skipped '/home/wwwroot/xxx'
求linux大神看看现在这个脚本的用户组和用户是www:www
参考php手册上面的代码,才看出来问题所在。
在下面也自问自答了,这里就不再粘贴复制了,直接链地址吧。
希望对其他遇到同样问题的朋友有所帮助!
http://stackoverflow.com/questions/21870660/access-a-phpscript-through-the-browser-to-execute-the-function-of-popen-som
其它类似信息

推荐信息