Hi everyone!
I need to copy some config text files (generated using SC) to an external asterisk server to upgrade changes. Using PHP FTP connection commands didnt work.
Here is my code:
$ftp_username = {user}; // User name
$ftp_userpass = {pass}; // User password
$ftp_server = {url}; // Destination server IP
// Set up basic connection
$conn_id = ftp_connect($ftp_server);
// Login with username and password
$login_result = ftp_login($conn_id, $ftp_username, $ftp_userpass);
// Check connection
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed! ";
echo “Attempted to connect to $ftp_server for user $ftp_username”;
}
else {
echo “Connected to $ftp_server, for user $ftp_username”;
}
…
Always post “FTP connection has failed”… User OK, Pass OK, Windows Firewall checked OK and allow FTP private and public.
How could I get this?
Any tips? Thank you