tags:

views:

284

answers:

4

I'm trying to write a little php to update an svn repo on a server running xampplite under windows. (This is a development server, not a production one.)

Here's my php:

<?php
passthru("update.bat"); 
// I also tried exec() & putting the svn command in directly
?>

update.bat is sitting in the same folder as the php script

Here's the content of update.bat:

svn up c:\path\to\my\repo

When I run the batch file by itself, it works. When I run it via php, I get this printed to the browser:

C:\path\to\script\folder>svn up c:\path\to\my\repo

which looks good, but the project isn't updated.

A: 

Try this tip on php.net/function.exec

TML
I can get it to run a simpler batch file (e.g. 'echo hi'), but the svn update is still eluding me.
sprugman
Sounds like something's screwy in your environment. Try comparing the phpinfo() for your command-line environment to the phpinfo() for the web process.
TML
A: 

The other option is to manually compile the php svn extension (there's no Windows DLL), but you also need the svn libraries first.

R. Bemrose
I sure hope I can avoid that solution. (Seems like overkill.)
sprugman
+1  A: 

Adding the username and password to the batch made the difference. Here's the new update.bat:

svn up --username <usr> --password <pwd> c:\path\to\the\repo
sprugman
A: 

hello friend i am using php on xampp and i need to know how should i create a batch file in my script

manish