[PHP] exec dont work for svn
hi, i want to do a svn update (subversion) from php using exec (or system) now, this works: exec("ls; pwd",$out); foreach($out as $line)echo"$line\n"; and this also works and print me the help from subversion: exec("svn help",$out); foreach($out as $line)echo"$line\n"; but this doesnt work: exec("svn update",$out); foreach($out as $line)echo"$line\n"; dont print anything... dont update the files, pwd returns me the correct path... any ideas? im using cpanel... php5 and fedora 4 php runs as nobody... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] exec dont work for svn
2007/5/28, Greg Donald <[EMAIL PROTECTED]>: On 5/28/07, Manolet Gmail <[EMAIL PROTECTED]> wrote: > but this doesnt work: > > exec("svn update",$out); > foreach($out as $line)echo"$line\n"; > > dont print anything... dont update the files Is it possible you need to provide some type of authentication? `svn update` may be asking for input your exec call isn't providing. well, i have error reporting (E ALL) and dont give me any error, also i try with svn update --non-interactive --username user --password pass and again... nothing appears. Also if the svn update ask for a password why php dont show it?, or why i dont receive a maximum ececution time of script error?. the script run instantly btw,.. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] exec dont work for svn
On 5/28/07, Manolet Gmail <[EMAIL PROTECTED]> wrote: but this doesnt work: exec("svn update",$out); foreach($out as $line)echo"$line\n"; dont print anything... dont update the files Is it possible you need to provide some type of authentication? `svn update` may be asking for input your exec call isn't providing. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] exec dont work for svn
Hi, In many apps the messages comes as STDERR, so try: exec("svn update 2>&1", $out); Best regards, Peter Lauri www.dwsasia.com - company web site www.lauri.se - personal web site www.carbonfree.org.uk - become Carbon Free > -Original Message- > From: Manolet Gmail [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 29, 2007 5:45 PM > To: PHP List > Subject: [PHP] exec dont work for svn > > 2007/5/28, Greg Donald <[EMAIL PROTECTED]>: > > On 5/28/07, Manolet Gmail <[EMAIL PROTECTED]> wrote: > > > but this doesnt work: > > > > > > exec("svn update",$out); > > > foreach($out as $line)echo"$line\n"; > > > > > > dont print anything... dont update the files > > > > Is it possible you need to provide some type of authentication? `svn > > update` may be asking for input your exec call isn't providing. > > well, i have error reporting (E ALL) and dont give me any error, also > i try with > > svn update --non-interactive --username user --password pass > > and again... nothing appears. Also if the svn update ask for a > password why php dont show it?, or why i dont receive a maximum > ececution time of script error?. > > the script run instantly btw,.. > > > > > > > -- > > Greg Donald > > http://destiney.com/ > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] exec dont work for svn
Hi, thanks petter, now im getting this error... svn: Can't check path '/root/.svn': Permission denied using this: $cmd = "svn up"; $cmd .= " --username $user --password $pass --non-interactive --revision $rev"; $cmd .= " --no-auth-cache --config-dir ~/.svn/ 2>&1"; i try with --config-dir /tmp/ with $_SERVER['document_root'] but always return me the same error, any idea? 2007/5/29, Peter Lauri <[EMAIL PROTECTED]>: Hi, In many apps the messages comes as STDERR, so try: exec("svn update 2>&1", $out); Best regards, Peter Lauri www.dwsasia.com - company web site www.lauri.se - personal web site www.carbonfree.org.uk - become Carbon Free > -Original Message- > From: Manolet Gmail [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 29, 2007 5:45 PM > To: PHP List > Subject: [PHP] exec dont work for svn > > 2007/5/28, Greg Donald <[EMAIL PROTECTED]>: > > On 5/28/07, Manolet Gmail <[EMAIL PROTECTED]> wrote: > > > but this doesnt work: > > > > > > exec("svn update",$out); > > > foreach($out as $line)echo"$line\n"; > > > > > > dont print anything... dont update the files > > > > Is it possible you need to provide some type of authentication? `svn > > update` may be asking for input your exec call isn't providing. > > well, i have error reporting (E ALL) and dont give me any error, also > i try with > > svn update --non-interactive --username user --password pass > > and again... nothing appears. Also if the svn update ask for a > password why php dont show it?, or why i dont receive a maximum > ececution time of script error?. > > the script run instantly btw,.. > > > > > > > -- > > Greg Donald > > http://destiney.com/ > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] exec dont work for svn
Did 'nobody' do the initial checkout? If not, 'nobody' probably can't have permission to do the update. On Mon, May 28, 2007 5:34 pm, Manolet Gmail wrote: > hi, i want to do a svn update (subversion) from php using exec (or > system) > > now, this works: > > exec("ls; pwd",$out); > foreach($out as $line)echo"$line\n"; > > and this also works and print me the help from subversion: > > exec("svn help",$out); > foreach($out as $line)echo"$line\n"; > > but this doesnt work: > > exec("svn update",$out); > foreach($out as $line)echo"$line\n"; > > dont print anything... dont update the files, pwd returns me the > correct path... > > any ideas? im using cpanel... php5 and fedora 4 php runs as nobody... > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] exec dont work for svn
On Tue, May 29, 2007 10:44 am, Manolet Gmail wrote: > 2007/5/28, Greg Donald <[EMAIL PROTECTED]>: >> On 5/28/07, Manolet Gmail <[EMAIL PROTECTED]> wrote: >> > but this doesnt work: >> > >> > exec("svn update",$out); exec("svn update", $out, $error); if ($error) echo "OS Error: $error. Use perror $error in shell to get message"; >> > foreach($out as $line)echo"$line\n"; >> > >> > dont print anything... dont update the files >> >> Is it possible you need to provide some type of authentication? >> `svn >> update` may be asking for input your exec call isn't providing. > > well, i have error reporting (E ALL) and dont give me any error, also > i try with > > svn update --non-interactive --username user --password pass > > and again... nothing appears. Also if the svn update ask for a > password why php dont show it?, or why i dont receive a maximum > ececution time of script error?. > > the script run instantly btw,.. > >> >> >> -- >> Greg Donald >> http://destiney.com/ >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] exec dont work for svn
2007/5/30, Richard Lynch <[EMAIL PROTECTED]>: On Tue, May 29, 2007 10:44 am, Manolet Gmail wrote: > 2007/5/28, Greg Donald <[EMAIL PROTECTED]>: >> On 5/28/07, Manolet Gmail <[EMAIL PROTECTED]> wrote: >> > but this doesnt work: >> > >> > exec("svn update",$out); exec("svn update", $out, $error); if ($error) echo "OS Error: $error. Use perror $error in shell to get message"; give me error 1: OS error code 1: Operation not permitted also, the checkout was did by other user. but i do chmod -R 777 * as root. so what i can do ? >> > foreach($out as $line)echo"$line\n"; >> > >> > dont print anything... dont update the files >> >> Is it possible you need to provide some type of authentication? >> `svn >> update` may be asking for input your exec call isn't providing. > > well, i have error reporting (E ALL) and dont give me any error, also > i try with > > svn update --non-interactive --username user --password pass > > and again... nothing appears. Also if the svn update ask for a > password why php dont show it?, or why i dont receive a maximum > ececution time of script error?. > > the script run instantly btw,.. > >> >> >> -- >> Greg Donald >> http://destiney.com/ >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] exec dont work for svn
On Wed, May 30, 2007 4:30 pm, Manolet Gmail wrote: > 2007/5/30, Richard Lynch <[EMAIL PROTECTED]>: >> >> >> On Tue, May 29, 2007 10:44 am, Manolet Gmail wrote: >> > 2007/5/28, Greg Donald <[EMAIL PROTECTED]>: >> >> On 5/28/07, Manolet Gmail <[EMAIL PROTECTED]> wrote: >> >> > but this doesnt work: >> >> > >> >> > exec("svn update",$out); >> >> exec("svn update", $out, $error); >> if ($error) echo "OS Error: $error. Use perror $error in shell to >> get >> message"; > > give me error 1: > OS error code 1: Operation not permitted > > also, the checkout was did by other user. but i do chmod -R 777 * as > root. > > so what i can do ? [shudder] Having a bunch of root owned files set to 777 is definitely the wrong way to go... Think about it for awhile. As far as the OS Error goes, we don't even know exactly what is wrong here... Maybe the PHP user can't run svn maybe the PHP user can run svn, but can't alter the hidden .svn files that you probably didn't chmod. Maybe... I'd suggest doing an 'su' to the PHP User and trying to do svn update on the command line, before you put PHP into the mix. You also should use a full path to 'svn' and you need to be in the right directory before you do 'svn', so I'd put a 'cd /whatever; svn up' instead. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php