我試圖使用phing自動化我的部署。我得到下面的錯誤,當我使用svnlastrevision任務PHP exec拋出意外結果
目標的「builddiff」執行失敗,原因如下:/home/ramjee/Work/Projects/it/dev-stack/build.xml:88:1 :無法解析'svn info --xml'的輸出。
在調試問題的進一步我歸零它在以下幾點:
下面是一個小程序來重現問題:
$cmd = "/usr/bin/svn info --non-interactive '/home/ramjee/Work/Projects/trunk/src' '--xml'";
exec("$cmd 2>&1",$out,$ret_var);
print_r($out);
當我執行上述
一世。隨PHP(5.2.17),隨附bitnami lampstack.1.2-5。我得到以下結果(不是預期的):
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。 PHP(5.3.17)是一個lampp安裝程序的一部分。我得到以下結果(預計):
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>
)
在第一行中,我們有兩個無用線,導致phing任務拋出錯誤。
我不知道如何解決這個問題?任何關於此的幫助將非常有價值。
看一看http://ubuntuforums.org/showpost.php?p=5883384&postcount=3和看看是否解決了你的問題。 – cmbuckley 2012-01-05 13:36:56
我試過了,並沒有幫助。我猜在這種情況下,庫是從燈路徑中選取的,而不是共享庫路徑。 (雖然不確定) – rAm 2012-01-05 23:26:44
一個奇怪的解決方法是刪除exec的'2>&1'部分,否則XML看起來有效。就錯誤而言,我只發現[this](http://stackoverflow.com/questions/3535110/svnserve-and-sasl-problem)。另外,有關共享對象的[更多信息](http://stackoverflow.com/questions/137773/what-does-the-no-version-information-available-error-from-linux-dynamic-linker)。 – cmbuckley 2012-01-06 00:02:18