Reproduce:
- Clean installation of octobercms 4.x, and use the media in the backend.
- Need to install the composer packages manually, mentioned in this link, for using FTP & SFTP media driver. Octobercms 3 update ftp problem - #4 by mkinternet
Symptom:
- SFTP works fine, but FTP is not.
- Try upload a single file using FTP driver will end with an error as below.
ftp_fput(): php_connect_nonb() failed: Operation now in progress (36)
- Try upload two files using FTP driver, the first one uploaded successfully, not for the second file.
Any idea?
Hey @jacksun101
This is a PHP FTP extension quirk rather than an October issue. The php_connect_nonb(): Operation now in progress error comes from the FTP data connection (the second socket PHP opens per transfer) failing to negotiate cleanly, which is why the first file often succeeds and the next one fails. SFTP works because it tunnels everything over a single SSH connection, so there’s no separate data channel to trip on.
Try adding these to your FTP disk config in config/filesystems.php:
'passive' => true,
'ignorePassiveAddress' => true,
'timeout' => 90,
'ssl' => false, // true if FTPS
Raising the timeout usually clears the “Operation now in progress” error, and ignorePassiveAddress handles the common case where the server advertises an internal IP behind NAT. Also make sure your FTP server’s passive port range is open in the firewall, since a too-small or blocked range would explain only the first transfer succeeding.
Honestly though, if SFTP is already working for you, I’d stick with it. Plain FTP over PHP’s extension is fragile for exactly these reasons, and the SFTP/S3 adapters are far more reliable for media storage.