Link to home
Start Free TrialLog in
Avatar of trickyidiot
trickyidiot

asked on

PHP: system/shell/passthru not working with svn update command

I have a script that is being used as a commit-hook for a subversion repository on another server.
I have tried using system, shell, shell_exec and passthru to run the svn update command.

With system and passthru, I get a returned value of '1' and nothing returned with the rest.

The command isn't actually processing.

The code for the file is listed below.

I have the file chmodded to 777 and it is within the web root.

non of the commands I am trying to use are disabled through php.ini or any other ini_set method.

What am I doing wrong here?
<?php
error_reporting(E_ALL);
 
$command = '/usr/bin/svn update /var/www/dev/webdata/pricelive';
system($command, $output);
echo "{$output}<br />";
 
$command = '/usr/bin/svn update /var/www/dev/webdata/pricelive_includes';
system($command, $output);
echo "{$output}<br />";
?>

Open in new window

Avatar of trickyidiot
trickyidiot

ASKER

I have now changed this over to use system to call a bash script to perform the update, which is in the code below

The echo statements from that bash script ARE returning, but the svn command isn't working.

I have the bash file chmodded to 777 (for testing)

What am I doing wrong here?
#!/bin/bash
echo "Updating pricelive"
cd /var/www/dev/webdata/pricelive
svn update
echo ""
echo "Updating pricelive_includes"
cd /var/www/dev/webdata/pricelive_includes
svn update

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<slaps forehead>

you're probably 100% right. I'm an idiot for not considering that.
I'll test once I get into work and award point as soon as I do.

Thank for you handing me my moron card.