Hi. I recently tried to use the FTP functions of PHP, but got the "call to undefined function" error. My systems administrator said he compiled PHP with
the --ftp option. Is there anything else we're missing? Thanks for the help.
FTP Funtions
I'm pretty sure that the switch is --enable-ftp
Note that if you throw php's configure script a bogus switch, it usually just ignores it, which may be what happened.
You may be right. My administratot actually used the "--with-ftp" switch.
Tim,
I'm sure your administrator was not able to successfully compile the php using -with-ftp parameters. That kind of error indicates that, "that functions was not supported because it was a function that is not supported by the current php binary/module".
Odd, since I just now did a:
su - root
cd /usr/local/src/php-4.0.4
./configure --with-ftp
make clean
make
and it worked...
Of course, the output from the .configure script clearly stated that ftp support was not being compiled in, but it just chugged away and built the php executable no complaints. But it built just fine.
This time, have him run ./configure like this:
./configure --with-switches |tee config.log
That will allow the output of configure to stream by on the screen as usual, but also copy that output to the file config.log for later perusal. Very nice to have around.
I compiled the PHP 4.0.5
./configure --with-ftp
It doesn't work.
Why?
It says:
Fatal error: Call to undefined function: ftp_connect()
The switch you see if --enable-ftp
Scott