CURL through PHP with SFTP support
I am using Ubuntu 16.04, running PHP7.0 and Magento2. I have installed a Magento Plugin which requires CURL SFTP to send an XML product feed to a remote server.
I noticed that the default CURL installed with Ubuntu does not support SFTP, so I followed instructions to re-compile it on the server, and now has support.
~$ curl -V
curl 7.62.0 (x86_64-pc-linux-gnu) libcurl/7.62.0 OpenSSL/1.1.1 libssh2/1.5.0
Release-Date: 2018-10-31
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets HTTPS-proxy
However, I did not realize that PHP has its own CURL library, and I don't know how to modify it to provide SFTP support.
I tried issuing "$ sudo apt-get install php7.0-curl" and it results in:
~$ sudo apt-get install php7.0-curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
php7.0-curl is already the newest version (7.0.32-4+ubuntu16.04.1+deb.sury.org+1).
However, this is not what is reported when I run phpinfo(). It is a different version and also SFTP protocol is not listed.
curl
cURL support enabled
cURL Information 7.47.0
Age 3
Protocols dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, smb, smbs, smtp, smtps, telnet, tftp
I'm not sure what next step to take is..
php curl ubuntu-16.04 sftp
add a comment |
I am using Ubuntu 16.04, running PHP7.0 and Magento2. I have installed a Magento Plugin which requires CURL SFTP to send an XML product feed to a remote server.
I noticed that the default CURL installed with Ubuntu does not support SFTP, so I followed instructions to re-compile it on the server, and now has support.
~$ curl -V
curl 7.62.0 (x86_64-pc-linux-gnu) libcurl/7.62.0 OpenSSL/1.1.1 libssh2/1.5.0
Release-Date: 2018-10-31
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets HTTPS-proxy
However, I did not realize that PHP has its own CURL library, and I don't know how to modify it to provide SFTP support.
I tried issuing "$ sudo apt-get install php7.0-curl" and it results in:
~$ sudo apt-get install php7.0-curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
php7.0-curl is already the newest version (7.0.32-4+ubuntu16.04.1+deb.sury.org+1).
However, this is not what is reported when I run phpinfo(). It is a different version and also SFTP protocol is not listed.
curl
cURL support enabled
cURL Information 7.47.0
Age 3
Protocols dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, smb, smbs, smtp, smtps, telnet, tftp
I'm not sure what next step to take is..
php curl ubuntu-16.04 sftp
You can alwaysexec()
or similar and access the command line tools of the host system - just be extra aware of the potential security issues. Or there may be a better way to do it - what are you trying to get done?
– ivanivan
Nov 24 '18 at 23:08
I had to do something very similar and the following link worked for me: stackoverflow.com/questions/4689540/how-to-sftp-with-php
– Aunt Jemima
Nov 24 '18 at 23:28
Thank you for the comments, yes, as a last resort I will look at re-programming the 3rd party plugin but I don't want to do that because then I can never upgrade it or receive support. In response to what I'm trying to get done, it is to get a google shopping feed setup on Magento2
– Art
Nov 26 '18 at 1:16
add a comment |
I am using Ubuntu 16.04, running PHP7.0 and Magento2. I have installed a Magento Plugin which requires CURL SFTP to send an XML product feed to a remote server.
I noticed that the default CURL installed with Ubuntu does not support SFTP, so I followed instructions to re-compile it on the server, and now has support.
~$ curl -V
curl 7.62.0 (x86_64-pc-linux-gnu) libcurl/7.62.0 OpenSSL/1.1.1 libssh2/1.5.0
Release-Date: 2018-10-31
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets HTTPS-proxy
However, I did not realize that PHP has its own CURL library, and I don't know how to modify it to provide SFTP support.
I tried issuing "$ sudo apt-get install php7.0-curl" and it results in:
~$ sudo apt-get install php7.0-curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
php7.0-curl is already the newest version (7.0.32-4+ubuntu16.04.1+deb.sury.org+1).
However, this is not what is reported when I run phpinfo(). It is a different version and also SFTP protocol is not listed.
curl
cURL support enabled
cURL Information 7.47.0
Age 3
Protocols dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, smb, smbs, smtp, smtps, telnet, tftp
I'm not sure what next step to take is..
php curl ubuntu-16.04 sftp
I am using Ubuntu 16.04, running PHP7.0 and Magento2. I have installed a Magento Plugin which requires CURL SFTP to send an XML product feed to a remote server.
I noticed that the default CURL installed with Ubuntu does not support SFTP, so I followed instructions to re-compile it on the server, and now has support.
~$ curl -V
curl 7.62.0 (x86_64-pc-linux-gnu) libcurl/7.62.0 OpenSSL/1.1.1 libssh2/1.5.0
Release-Date: 2018-10-31
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets HTTPS-proxy
However, I did not realize that PHP has its own CURL library, and I don't know how to modify it to provide SFTP support.
I tried issuing "$ sudo apt-get install php7.0-curl" and it results in:
~$ sudo apt-get install php7.0-curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
php7.0-curl is already the newest version (7.0.32-4+ubuntu16.04.1+deb.sury.org+1).
However, this is not what is reported when I run phpinfo(). It is a different version and also SFTP protocol is not listed.
curl
cURL support enabled
cURL Information 7.47.0
Age 3
Protocols dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, smb, smbs, smtp, smtps, telnet, tftp
I'm not sure what next step to take is..
php curl ubuntu-16.04 sftp
php curl ubuntu-16.04 sftp
asked Nov 24 '18 at 23:03
ArtArt
111
111
You can alwaysexec()
or similar and access the command line tools of the host system - just be extra aware of the potential security issues. Or there may be a better way to do it - what are you trying to get done?
– ivanivan
Nov 24 '18 at 23:08
I had to do something very similar and the following link worked for me: stackoverflow.com/questions/4689540/how-to-sftp-with-php
– Aunt Jemima
Nov 24 '18 at 23:28
Thank you for the comments, yes, as a last resort I will look at re-programming the 3rd party plugin but I don't want to do that because then I can never upgrade it or receive support. In response to what I'm trying to get done, it is to get a google shopping feed setup on Magento2
– Art
Nov 26 '18 at 1:16
add a comment |
You can alwaysexec()
or similar and access the command line tools of the host system - just be extra aware of the potential security issues. Or there may be a better way to do it - what are you trying to get done?
– ivanivan
Nov 24 '18 at 23:08
I had to do something very similar and the following link worked for me: stackoverflow.com/questions/4689540/how-to-sftp-with-php
– Aunt Jemima
Nov 24 '18 at 23:28
Thank you for the comments, yes, as a last resort I will look at re-programming the 3rd party plugin but I don't want to do that because then I can never upgrade it or receive support. In response to what I'm trying to get done, it is to get a google shopping feed setup on Magento2
– Art
Nov 26 '18 at 1:16
You can always
exec()
or similar and access the command line tools of the host system - just be extra aware of the potential security issues. Or there may be a better way to do it - what are you trying to get done?– ivanivan
Nov 24 '18 at 23:08
You can always
exec()
or similar and access the command line tools of the host system - just be extra aware of the potential security issues. Or there may be a better way to do it - what are you trying to get done?– ivanivan
Nov 24 '18 at 23:08
I had to do something very similar and the following link worked for me: stackoverflow.com/questions/4689540/how-to-sftp-with-php
– Aunt Jemima
Nov 24 '18 at 23:28
I had to do something very similar and the following link worked for me: stackoverflow.com/questions/4689540/how-to-sftp-with-php
– Aunt Jemima
Nov 24 '18 at 23:28
Thank you for the comments, yes, as a last resort I will look at re-programming the 3rd party plugin but I don't want to do that because then I can never upgrade it or receive support. In response to what I'm trying to get done, it is to get a google shopping feed setup on Magento2
– Art
Nov 26 '18 at 1:16
Thank you for the comments, yes, as a last resort I will look at re-programming the 3rd party plugin but I don't want to do that because then I can never upgrade it or receive support. In response to what I'm trying to get done, it is to get a google shopping feed setup on Magento2
– Art
Nov 26 '18 at 1:16
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53463133%2fcurl-through-php-with-sftp-support%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53463133%2fcurl-through-php-with-sftp-support%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You can always
exec()
or similar and access the command line tools of the host system - just be extra aware of the potential security issues. Or there may be a better way to do it - what are you trying to get done?– ivanivan
Nov 24 '18 at 23:08
I had to do something very similar and the following link worked for me: stackoverflow.com/questions/4689540/how-to-sftp-with-php
– Aunt Jemima
Nov 24 '18 at 23:28
Thank you for the comments, yes, as a last resort I will look at re-programming the 3rd party plugin but I don't want to do that because then I can never upgrade it or receive support. In response to what I'm trying to get done, it is to get a google shopping feed setup on Magento2
– Art
Nov 26 '18 at 1:16