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.
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
I ran into the same issue. After I checked this one setting, it worked just fine.
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".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With