I'm trying to connect to some other FTP server using PHP and upload a file to it.
On my local machine the code is working absolutely fine but when I run this code from my staging server I got following warning and I'm not able to communicate with the FTP server.
Following is the warning I got.
Warning: ftp_put() [function.ftp-put]: I won't open a connection to 10.140.166.143 (only to 52.232.262.219) in /code/sites/my_web/model/Request.php on line 193
52.232.262.219 is the ip address of my staging server.
The line 193 is as follows:
$file_upload_status = ftp_put($conn_id, $remote_file, $file, FTP_BINARY);
Note: I'm not putting all the code since it's working from my local machine. It's not working only from the staging server.
Is this happening due to the settings in php.ini file. Since php.ini file on my local might have some different setting for this than the php.ini file present on staging server.