Welcome Guest, Not a member yet? Register   Sign In
[solved] FTP class not connecting
#1

[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?
#2

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

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

[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




Theme © iAndrew 2016 - Forum software by © MyBB