Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ftp_connect fatal error : call undefined function

For some reason the ftp_connect() function doesn't work, when I try to used it it ends with a fatal error stating that this function is undefined... Surprisingly I can still use a ftp client or use an ftp connection through the Terminal. How may I solve this problem ?

I run on Mountain Lion et I've got the 5.3 php version - I reinstalled it once hoping this would solve my problem.

like image 656
bash_profile blank Avatar asked Aug 27 '13 14:08

bash_profile blank


3 Answers

Check PHP FTP installation manual

On PHP 7, You can enable it by adding this line to the php.ini file.

extension=php_ftp.dll

On PHP 8+ enable this line in php.ini:

extension=ftp
like image 141
Black Senator Avatar answered Nov 09 '22 06:11

Black Senator


I ran into the same issue. After I checked this one setting, it worked just fine.

enter image description here

like image 10
user1854438 Avatar answered Nov 09 '22 06:11

user1854438


Sounds like your PHP was not installed with --enable-ftp or that the ftp module is disabled in your php.ini.

To check if ftp is enabled, create a page like this and browse to it:

<?php
phpinfo();
?>

Look for "ftp support", it should be marked "enabled".

like image 8
Menthos Avatar answered Nov 09 '22 04:11

Menthos