Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7035259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:16:59+00:00 2026-05-28T01:16:59+00:00

I am trying to automate my deployment using phing. I get the below error

  • 0

I am trying to automate my deployment using phing. I get the below error when I use svnlastrevision task

Execution of target “builddiff” failed for the following reason: /home/ramjee/Work/Projects/it/dev-stack/build.xml:88:1: Failed to parse the output of ‘svn info –xml’.

On debugging the issue further I zeroed it on to the following:

The following is a small program to recreate the issue:

$cmd = "/usr/bin/svn info --non-interactive '/home/ramjee/Work/Projects/trunk/src' '--xml'";
exec("$cmd 2>&1",$out,$ret_var);

print_r($out);

When I execute the above

i. With PHP (5.2.17) that is shipped with bitnami lampstack.1.2-5. I get the following result (not expected):

Array
(
    [0] => /usr/bin/svn: /home/ramjee/Work/lampstack-1.2-5/common/lib/libsasl2.so.2: no version information available (required by /usr/lib/libldap_r-2.4.so.2)
    [1] => /usr/bin/svn: /home/ramjee/Work/lampstack-1.2-5/common/lib/libsasl2.so.2: no version information available (required by /usr/lib/libsvn_ra_svn-1.so.1)
    [2] => <?xml version="1.0"?>
    [3] => <info>
    [4] => <entry
    [5] =>    kind="dir"
    [6] =>    path="/home/ramjee/Work/Projects/trunk/src"
    [7] =>    revision="818">
    [8] => <url>svn://abc.abc.abc.abc/data/repositories/src</url>
    [9] => <repository>
    [10] => <root>svn://abc.abc.abc.abc/data/repositories/</root>
    [11] => <uuid>f74a063e-5e8e-11e0-b400-13ff509e0209</uuid>
    [12] => </repository>
    [13] => <wc-info>
    [14] => <schedule>normal</schedule>
    [15] => <depth>infinity</depth>
    [16] => </wc-info>
    [17] => <commit
    [18] =>    revision="802">
    [19] => <author>shweta</author>
    [20] => <date>2012-01-03T12:07:46.427638Z</date>
    [21] => </commit>
    [22] => </entry>
    [23] => </info>
)

ii. With PHP (5.3.17) which was part of a lampp setup. I get the following result (expected):

Array
(
    [0] => <?xml version="1.0"?>
    [1] => <info>
    [2] => <entry
    [3] =>    kind="dir"
    [4] =>    path="/home/ramjee/Work/Projects/trunk/src"
    [5] =>    revision="818">
    [6] => <url>svn://abc.abc.abc.abc/data/repositories/src</url>
    [7] => <repository>
    [8] => <root>svn://abc.abc.abc.abc/data/repositories/</root>
    [9] => <uuid>f74a063e-5e8e-11e0-b400-13ff509e0209</uuid>
    [10] => </repository>
    [11] => <wc-info>
    [12] => <schedule>normal</schedule>
    [13] => <depth>infinity</depth>
    [14] => </wc-info>
    [15] => <commit
    [16] =>    revision="802">
    [17] => <author>shweta</author>
    [18] => <date>2012-01-03T12:07:46.427638Z</date>
    [19] => </commit>
    [20] => </entry>
    [21] => </info>
)

In the first line we have two unwanted lines which cause the phing task to throw error.

I don’t know how to fix this? Any help on this will be very valuable.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:17:00+00:00Added an answer on May 28, 2026 at 1:17 am

    This is not a great solution, as it simply masks the problem (and potentially other problems), but you can remove the 2>&1 part from the exec:

    exec($cmd, $out, $ret_var);
    

    2>&1 is used in bash to redirect STDERR (where the first 2 lines are being sent) to STDOUT (where the XML is sent) — see this question for more information.

    The impact of this is that you’re masking the error, and any other errors that you may encounter in the future from that command. Here’s a longer solution that still involves you patching the library, but at least feels like less of a hack:

    $cmd = "/usr/bin/svn info --non-interactive '/home/ramjee/Work/Projects/trunk/src' '--xml'";
    
    $descriptors = array(
        1 => array('pipe', 'w'), // stdout
        2 => array('pipe', 'w')  // stderr
    );
    
    $process = proc_open($cmd, $descriptors, $pipes);
    
    $out = $err = '';
    while ($data = fgets($pipes[1])) { $out .= $data; } // contains your XML
    while ($data = fgets($pipes[2])) { $err .= $data; } // contains any errors (which you can log)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use Phing to automate : running tests running DB migrations on
I am trying to automate my testing procedure using Ant. This is my error:
I am trying to automate our build/deployment process. So far I am using: a
My team is currently trying to automate the deployment of our .Net and PHP
I'm trying to automate a gdb session using the --command flag. I'm trying to
I am trying to automate functional testing of a server using a realistic frequency
I am trying to automate VC++ build via an addIn written using VB.NEt so
I'm trying to figure out a way to automate the deployment to our QA
I'm trying to automate the generation and cleanup of partial classes created using the
I am trying to automate pde tests, using pde-maven-plugin, maven calls, or ant tasks.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.