cURL / Mailing Lists / curl-users / Single Mail

curl-users

cURL command works in command line but not in php exec()

From: Rob Mills <rob.mills_at_sitemakers.co.uk>
Date: Sat, 23 Aug 2008 18:47:45 +0100

Hi all.

I'm having a problem that a cURL command works in command line but not
in php exec(), this is the command:

curl -u user:pass -T /home/ftpuser/public_html/test
sftp://127.0.0.1/Usr/remoteuser/

That works but when run in php like this:

exec("curl -u user:pass -T /home/ftpuser/public_html/test
sftp://127.0.0.1/Usr/remoteuser/");

it doesnt work and the following error appears in the logs:

curl: (1) Unsupported protocol: sftp

I added a "--trace" to the command and got this in the logs:

== Info: gethostbyname_r(2) failed for user:pass
== Info: Couldn't resolve host 'user:pass'
== Info: Closing connection #0
curl: (6) Couldn't resolve host 'user:pass'
== Info: Unsupported protocol: sftp
curl: (1) Unsupported protocol: sftp

Would really appreciate any help ideas on this.

By the way, i know i should really be doing this with the SSH2 library
but i am not able to install it on the server.
 
Thanks.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2008-08-23