$ftp = JClientFtp::getInstance($ftp_host, $ftp_port, array(), $ftp_user, $ftp_pass);
//$filename is the name of the file to write on the remote server
//$output is a string holding the contents that you want to write
$ftp->write($filename, $output);
A file gets written to the remote server containing the contents of $output
The file does not get written
There is a warning in site error log
PHP Warning: fopen(): Unable to find the wrapper "buffer" - did you forget to enable it when you configured PHP? in /path/to/joomla/libraries/src/Client/FtpClient.php on line 1159:
Web Server Apache/2.4.28 (Unix)
WebServer to PHP Interface cgi-fcgi
PHP Version 7.0.24
Joomla! Version Joomla! 3.8.1 Stable
the line throwing the error is this
$tmp = fopen('buffer://tmp', 'br+');
It looks like the issue is this: buffer:// is not a standard PHP wrapper so needs to be registered as a stream wrapper. It seems this should happen in the FtpClient class constructor:-
\JLoader::load('JBuffer');
The Buffer class should register the stream wrapper, it seems that this is not happening.
Category | ⇒ | Plugins |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-10-26 13:53:03 |
Closed_By | ⇒ | mbabker |
Thanks Michael Babker
See #18075 for solution.