$username_ftp = "user";
$password_ftp = "password";
$file_name = "remote-transfer.txt";
$url = "example.biz/test/" . $file_name;
$hostname = "ftp://$username_ftp:$password_ftp@$url";
$content = file_get_contents('index.html');
$options = array('ftp' => array('overwrite' => true));
$stream = stream_context_create($options);
file_put_contents($hostname, $content, 0, $stream);
I try to put a file from my remoter server to another remote server while i exixute this code from my localhost it work file and i transfer a file from my ocal pc to server. But When i try to exicute this code from my AWS server it not transfer any file , When i check my error log file its gives
PHP Warning: file_put_contents(): connect() failed: Permission denied
PHP Warning: file_put_contents(ftp://...@example.biz/remote-transfer.txt): failed to open stream: operation failed in
my test folder permission is 777 now what to do, is there any server configuration which is miss to do .