PHP: How to exec 'svn up' in Linux
I want to visit a url via http://xxxxx.php then my server will update automatically
I try to many way to use php execut开发者_开发技巧e "svn update" on my server Like:
system('./svn.sh', $retval); //svn.sh contain svn up ....
system('svn up .', $retval);
system('/usr/bin/svn up --username xxx --password --- /my_path', $retval);
PS :I don not want to use third party php extension for subversion Thanks !!!
I wouldn't use php for this type of task. Rather I would use ssh to publish from the localhost to the remote host to bring that server up to date
ssh my_user@my_host.com "/usr/bin/svn up /my_path"
This is more secure and more suited for a system level task.
Did you test permissions on /my_path
? it has to be writeable by your webserver user. Additionally, you can use exec
instead of system
which also returns every line of output.
exec('/usr/bin/svn up --username xxx --password --- /my_path', $output, $retval);
print_r($output);
The above will give you hints where it fails
精彩评论