Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-10-02
3
Medium Priority
?
1,226 Views
Last Modified: 2013-12-20
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

0
Comment
Question by:trickyidiot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Author Comment

by:trickyidiot
ID: 22625341
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

0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 2000 total points
ID: 22631879
what do you get when you issue
  svn update
in a shell as user which runs the web server
0
 
LVL 6

Author Comment

by:trickyidiot
ID: 22633122
<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.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question