CodeIgniter Forums
[solved] FTP class not connecting - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: [solved] FTP class not connecting (/showthread.php?tid=9306)



[solved] FTP class not connecting - El Forum - 06-20-2008

[eluser]FinalFrag[/eluser]
I'm trying to make a function that mirrors all the files from the website on which the application is running to another webserver. But there seems to be a problem with the FTP class. I have the following code:

Code:
function something() {
        $this->load->library('ftp');
        
        $config['hostname'] = 'ftp.mywebsite.be';
        $config['username'] = 'my_username';
        $config['password'] = 'my_password';
        $config['port']     = 21;
        $config['passive']  = true;
        $config['debug']    = true;
        
        $this->ftp->connect($config);
        
        echo 'show me this and exit...';
        exit();
}

Obviously, it should show me the message, but all it does is give me a blank page... Not even an error...

Can anyone give me a hand on this?


[solved] FTP class not connecting - El Forum - 06-20-2008

[eluser]Raiko[/eluser]
If you remove the exit, does it show?


[solved] FTP class not connecting - El Forum - 06-20-2008

[eluser]FinalFrag[/eluser]
Nope, it does nothing after the connect command Confused


[solved] FTP class not connecting - El Forum - 06-20-2008

[eluser]FinalFrag[/eluser]
I took a look in the code behind the CI functions and it turns out it uses the native PHP function 'ftp_connect'. When I created a page with just this function on it I got:

Code:
Call to undefined function ftp_connect()

I looked this error up on google and on some forum people say php has to be installed with the --enable-ftp option, which is not the case with my host...

So it wasn't a code or CI problem, just my stupid host Smile