首页 > Web开发 > 详细

使用SVN钩子运行PHP更新服务器代码的注意事项

时间:2014-08-02 18:14:43      阅读:191      评论:0      收藏:0      [点我收藏+]

想通过本地提交代码到SVN服务器,同时同步测试服务器的代码

使用SVN钩子,运行服务器的php文件

代码如下:

<?php
header("Content-Type: text/html; charset=utf-8");
header("Cache-Control:no-cache,must-revalidate");

$username = ‘用户名‘;    
$password = ‘密码‘;    
$target_dir = ‘路径‘;    
     
exec("sudo svn up --username $username --password $password $target_dir 2>&1", $output);  
print_r($output);
?>

 

 

注意事项

1.存放php文件的路径需有写的权限,最简单就是设为777

2.参考http://aben328.iteye.com/blog/1070850

之前出现Can‘t open file Permission denied的错误

使用ll 文件路径/.svn,发现用户都是root

可以使用chown –R apache:apache 文件路径

修改

使用SVN钩子运行PHP更新服务器代码的注意事项,布布扣,bubuko.com

使用SVN钩子运行PHP更新服务器代码的注意事项

原文:http://www.cnblogs.com/gachal/p/3887209.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!